找到nginx.conf
server{
listen 8081;
server_name www.p2pfast.com;
location / {
proxy_pass http://localhost:8080/;
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
支持websocket把这两行配置加上就可以了
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
放在自己server里的location ~ / {
}里面。