作者/来源:yixinu.com
栏目:运维/编程
日期:2021-06-17 04:17:35
upstream xxx_wss{
server 127.0.0.1:1080;
keepalive 300;
}
server {
listen 443 ssl;
ssl on;
server_name xx.xx.com;
root /var/www/xx/;
charset utf-8;
#证书配置
ssl_certificate /var/vab/xx.pem;
ssl_certificate_key /var/vab/xx.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html/;
}
location /xx/wss {
proxy_pass http://xxx_wss;proxy_connect_timeout 120s;
proxy_read_timeout 300s;
proxy_send_timeout 120s;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
}
}