http {
# websocket http中配置添加
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
location /server/ {
# websocket server 中配置添加
proxy_http_version 1.1;
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 12s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
}
网友评论