NGINX HTTPS 配置
NGINX.conf
events {
worker_connections 1024;
}
http {
server {
listen 443;
server_name XXX;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt; # 证书配置
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;#SSLv2 SSLv3 TLSv1;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; #ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
location / {
#root html;
#index testssl.html index.html index.htm;
proxy_pass http://127.0.0.1:8888;
proxy_set_header X-Real-IP $remote_addr;
}
}
include /etc/nginx/conf.d/*.conf; # 导入配置
}
XXX.conf
server {
listen 80;
server_name XXX;
#使用return的效率会更高
location /{
proxy_pass http://127.0.0.1:8888;
}
return 301 https://$server_name$request_uri;
}
posted on 2018-02-22 22:42 0o0o0o0o0o000 阅读(158) 评论(0) 编辑 收藏 举报