参考:http://blog.onovps.com/archives/nginx-ssl-https.html
生成证书与密钥:
openssl req -new -x509 -nodes -out server.crt -keyout server.key
会提示输入一些信息。
设置权限:
chmod 400 server.*
nginx配置:
listen 80; listen 443 ssl; ssl on; ssl_certificate /opt/ProgramFiles/nginx/conf/ssl/server.pem; ssl_certificate_key /opt/ProgramFiles/nginx/conf/ssl/server.key;
重启Nginx服务即可!