第一个nginx
server { listen 6794; root /mnt/dist; location /analyze/ { proxy_pass http://ip:port; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location / { try_files $uri $uri/ =404; } }
第二个
server { listen 6791; root /mnt/dist; location /visual/ws/ { proxy_pass http://ip:port; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /task/ { proxy_pass http://ip:port;; } location /visual/ { proxy_pass http://ip:port; } location /analyze { rewrite /analyze(.*) $1 last; } location / { try_files $uri $uri/ =404; } }
标签:set,http,header,ip,nginx,location,转发,websocket,proxy From: https://www.cnblogs.com/testzcy/p/17015508.html