websocket 请求经过 nginx 后,可能会不正常,需要如下配置,相关的头才可以

    1. map $http_upgrade $connection_upgrade {
    2. default upgrade;
    3. '' close;
    4. }
    5. server {
    6. listen 80;
    7. server_name 192.168.1.1;
    8. charset utf-8;
    9. location /stomp/ {
    10. proxy_pass http://192.168.7.2:9541;
    11. # client_max_body_size 500M;
    12. proxy_http_version 1.1;
    13. proxy_set_header Upgrade $http_upgrade;
    14. proxy_set_header Connection $connection_upgrade;
    15. }
    16. }