编辑/etc/nginx/app.d/server.ReverseProxy.conf文件,添加以下两段,然后保存退出。执行nginx -s reload命令重载配置。

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;

群晖布署sshwifty远程终端 nginx配置 经验教程 第1张

参考文档:
https://www.xncoding.com/2018/03/12/fullstack/nginx-websocket.html
http://pankajmalhotra.com/Websockets-SSL-TLS-Termination-Using-NGINX-Proxy

参与评论