ssl 搞了半天没搞好 网上一大堆教程就是各种 - Assbbs
ssl 搞了半天没搞好 网上一大堆教程就是各种访问不了,下面这样配行不行反正能访问了,大佬们帮忙改进一下要最优的方案要支持千万级访问的方案。 ------------- SSL -------------- server { listen 80; 填写绑定证书的域名 server name www.xxxxx.com xxxx.com; 把http的域名请求…
ssl 搞了半天没搞好 网上一大堆教程就是各种访问不了,下面这样配行不行反正能访问了,大佬们帮忙改进一下要最优的方案要支持千万级访问的方案。 ------------- SSL -------------- server { listen 80; 填写绑定证书的域名 server name www.xxxxx.com xxxx.com; 把http的域名请求转成https return 301 https://www.xxxxx.com$request uri; return 301 https://www.xxxxx.cn; } ------------- SSL --------------- server { -----HTTPS template start------------ listen 443 ssl; server name www.xxxxx.com xxxxx.com; ssl certificate /usr/local/nginx/conf/ssl/xxxxx.crt; ssl certificate key /usr/local/nginx/conf/ssl/xxxxx.key; ssl session timeout 5m; ssl protocols TLSv1 TLSv1.1 TLSv1.2; ssl ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl prefer server ciphers on; root /home/wwwroot/default; index index.html index.htm index.php; -----HTTPS template start------------ error page 404 /404.html; Deny access to PHP files in specific directory location ~ / wp-content|uploads|wp-includes|images /. \.php$ { deny all; } include enable-php.conf; location /nginx status { stub status on; access log off; } location ~ . \. gif|jpg|jpeg|png|bmp|swf $ { expires 30d; } location ~ . \. js|css ?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } access log /home/wwwlogs/access.log; }