Nginx配置SSL

原创
2020/04/14 09:43
阅读数 83

第一步:在线生成SSL证书和Key

第二步:在Nginx的nginx.config中配置SSL

  
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice; 
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}

stream {

}




http {
    include       mime.types;
    default_type  application/octet-stream;
    fastcgi_buffers 8 256k;
	fastcgi_buffer_size 256k;
	fastcgi_busy_buffers_size 256k;
	fastcgi_temp_file_write_size 256k;
    send_timeout 60s;
	fastcgi_connect_timeout 300s;
	fastcgi_send_timeout 300s;
	fastcgi_read_timeout 300s;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  1000;
	proxy_read_timeout 1200;

   	server {
		listen 443;
		server_name 10.17.1.39;
		ssl on;
		root /opt/IBM/HTTPServer/htdocs/online;
		index index.html index.htm;
		ssl_certificate  /opt/IBM/RaCert/wy001.pem;
		ssl_certificate_key /opt/IBM/RaCert/wy001.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;
		location / {
			index index.html index.htm;
		}
		location /pweb/ {
			proxy_pass http://10.17.1.39:9084/pweb/;
			proxy_redirect          off;
		}
	}

}

第三部:启动Nginx完成配置

展开阅读全文
打赏
0
0 收藏
分享
加载中
在线生成SSL地址:https://myssl.com/csr_create.html
2020/04/14 10:04
回复
举报
在线生成SSL地址:https://www.ssleye.com/self_sign.html
2020/04/14 10:38
回复
举报
更多评论
打赏
2 评论
0 收藏
0
分享
返回顶部
顶部