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;
}
多少访问量看服务器配置吧……
SSL这我真不太懂,都是certbot一键配置完的……
好像优化与否跟SSL关系也不大。
基本上先从机器配置着手的。
要最优的方案要支持千万级访问的方案?
你这白嫖?
真千万级的并发,花点钱吧。
千万级访问不是优化配置能解决的
........好吧,我就是想问问这个配置文件有没有问题,要不要修改什么,到网上找了一大堆教程全都报错,这个还是以前用过的可以正常跳https,帮忙看看有没有需要改的地方[em_20]
Mozilla 的 SSL 配置生成器
https://ssl-config.mozilla.org/