nginx 实现https 配置文件

server {
listen 80;
listen 443 ssl;
server_name dev.skyline.walkyren.com;

ssl_certificate /root/cert/214890660060476.pem;
ssl_certificate_key /root/cert/214890660060476.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:8081;
}
}

注意:
1.首先需要进行域名,ip地址的映射
2.可以在阿里云申请免费的ssl证书
3.https默认监听服务器的443端口

你可能感兴趣的:(Nginx,nginx,https)