nginx代理websocket錯誤處理

錯誤貼圖nginx

BTYELRP`SZVO6F(0SP65`EW.png

nginx日誌報400 bad request錯誤ide

修改nginx配置文件日誌

添加一下三行server

server {rem

    listen 80;it

    server_name  localhost;io

    proxy_set_header Host $host:$server_port;class

    proxy_set_header X-Real-Ip $remote_addr;proxy_pass

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;配置


    location / {

        #proxy_set_header Host $host:$server_port;

        #proxy_set_header X-Real-Ip $remote_addr;

        #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_pass http://127.0.0.1:8000;

        proxy_http_version 1.1;    #添加

        proxy_set_header Upgrade $http_upgrade;    #添加

        proxy_set_header Connection "upgrade";    #添加

    }


}

相關文章
相關標籤/搜索