server {
listen 80;
server_name aaa.bbb.com; # 你的网址名称
# 转发websocket需要的设置
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
# 所有请求都转发
location / {
proxy_pass http://192.168.1.184:8000/;
}
}
nginx配置websocket
最新推荐文章于 2024-07-22 13:11:05 发布