Chrome、Firefox等现代浏览器支持了TLSv1.3,用chrome浏览器,F12打开开发者工具-Security,如图:
现在宝塔面板 Nginx安装1.15版本及以上是默认支持TSL1.3的,只是还需要修改一下加密套件的部分以便支持TSL1.3协议,下面附上一份nginx完整配置参考备用
2. nginx ssl配置完整示例:
server {
listen 80;
listen 443 ssl http2;
server_name xxx;
charset utf-8;
access_log /var/log/nginx/access.log main;
ssl_certificate certs/full_chain.pem;
ssl_certificate_key certs/private.key;
#OCSP Stapling开启,OCSP是用于在线查询证书吊销情况的服务,使用OCSP Stapling能将证书有效状态的信息缓存到服务器,提高TLS握手速度
ssl_stapling on;
#OCSP Stapling验证开启
ssl_stapling_verify on;
#用于查询OCSP服务器的DNS
resolver 8.8.8.8 114.114.114.114 valid=300s;
#查询域名超时时间
resolver_timeout 5s;
#SSL优化配置
#Session Cache,将Session缓存到服务器,这可能会占用更多的服务器资源
ssl_session_cache builtin:1000 shared:SSL:10m;
#开启浏览器的Session Ticket缓存
ssl_session_tickets on;
#SSL session过期时间
ssl_session_timeout 10m;
#只启用 TLS 系列协议
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
#加密套件,这里用了CloudFlare's Internet facing SSL cipher configuration
ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
#由服务器协商最佳的加密算法
ssl_prefer_server_ciphers on;
#开启HSTS,并设置有效期为9460800秒(9个月),包括子域名(根据情况可删掉):includeSubdomains,预加载到浏览器缓存(根据情况可删掉)
add_header Strict-Transport-Security "max-age=15768001; preload";
#禁止被嵌入框架
#add_header X-Frame-Options DENY;
#防止在IE9、Chrome和Safari中的MIME类型混淆攻击
add_header X-Content-Type-Options nosniff;
#处理静态资源:
location ~ ^\/static\/.*$ {
root /xxx;
access_log off;
}
location / {
proxy_pass http://127.0.0.1:110;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
暂无评论