ssw=websocket+ssl 域名申请ssl证书,如果项目还没有配置https证书到这里看看
server {
server_name www.xx.com;
error_log /var/log/nginx/www.xx.error.log ;
access_log /var/log/nginx/ws.xx.access.log;
location / { # 新增代理
proxy_pass http:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; # 升级协议头
}
# 域名的ssl认证
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.xx.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.xx.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
|