upstream webwebsocket {
server 192.168.0.4:8889; # 后端 Jar 服务的地址和端口
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
location /otoyix-websocket {
proxy_pass http://webwebsocket; #websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
-------------end