##开启并配置SSL 1234567891011server { listen 443; server_name skyf.org www.skyf.org; ssl on; # CA下发的SSL证书 ssl_certificate /etc/nginx/ssl_certificate/skyf_cer.crt; # 证书私钥 ssl_certificate_key /etc/nginx/ssl_certificate/skyf_cer.key; ...code} 所有HTTP请求转到HTTPS123456server { listen 80; server_name skyf.org www.skyf.org; rewrite ^(.*) https://$server_name$1 permanent;} 配置完毕,重启nginx即可。 ← Previous Post Next Post →