# websocket代理
location /socket/ {
proxy_http_version 1.1; #webscoket连接代理服务器必须使用http 1.1版本,默认
proxy_set_header Connection "Upgrade";
proxy_set_header Upgrade "websocket";
proxy_set_header REMOTE-HOST $remote_addr;
proxy_pass http://localhost:9500/; #服务器地址
}
nginx配置websocket转发
最新推荐文章于 2024-04-28 14:34:24 发布