Nginx 配置 HTTPS 发表于 2018-12-31 | 更新于 2020-11-03 | 分类于 Linux | 阅读次数: 配置文件基本如下,请参考并进行相应的修改 123456789101112131415161718192021222324server { listen 80; server_name domain.example.com ; #修改为自己的域名 rewrite ^(.*)`$ https://$`host$1 permanent; }server { listen 443; server_name domain.example.com; #修改为自己的域名 ssl on; root html; #html修改为网站的对应路径 index index.html index.htm; ssl_certificate cert/yourcrt.pem; #将证书添加到相应的文件夹 ssl_certificate_key cert/yourkey.key; #将密钥添加到相应的文件夹 ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { root html; #html修改为网站的对应路径 index index.html index.htm; }} 打赏 微信支付 支付宝