今天在使用websoket的時候,發現沒法鏈接到nginx代理的服務器,最後的解決辦法是在nginx的配置文件裏面加上下面這個配置location /websocket:nginx
location /websocket {
proxy_pass http://ip:端口;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";web
} 服務器