1.Nginx 版本
目前 Nginx 1.18 是默认支持的,低版本没有测试过。
2.虚拟主机配置
以 source.yonghong.me 为例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| server { listen 443 ssl http2; listen [::]:443 ssl http2;
server_name source.yonghong.me;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE; ssl_prefer_server_ciphers on;
ssl_certificate /etc/cert/live/yonghong.me/fullchain.pem; ssl_certificate_key /etc/cert/live/yonghong.me/privkey.pem; ssl_trusted_certificate /etc/cert/live/yonghong.me/chain.pem;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
location / { proxy_pass http://sourcegraph:7080; } }
server { listen 80; listen [::]:80;
server_name source.yonghong.me;
location / { return 301 https://source.yonghong.me$request_uri; } }
|
3.注意注意注意
如果开启了TLSv1.3,那么所有的虚拟主机都需要开启,否则开启会失败!!!
如果开启了TLSv1.3,那么所有的虚拟主机都需要开启,否则开启会失败!!!
如果开启了TLSv1.3,那么所有的虚拟主机都需要开启,否则开启会失败!!!
4.检测
https://myssl.com/


