## 强制将http 转向到https
server {
listen 80;
server_name www.xxxx.com;
return 301 https://$server_name$request_uri;
}
## 监听443 端口。
server {
listen 443;
server_name www.xxxx.com;
ssl on;
## 证书路径
ssl_certificate /usr/local/nginx/conf/1522725797929.pem;
ssl_certificate_key /usr/local/nginx/conf/1522725797929.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location / {
#root html;
#index index.html index.htm;
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host $host;
proxy_pass_header User-Agent;
}
}
22 篇文章
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!