0

real address => https://wssserver1/wss/ Only test1 able to access, try using proxy_pass for other testX able to browse wssserver1.

When I open it from test2 https://test1/wssserver1, it manage to update the header name but nothing appear. error log show it direct wss path to localhost instead of wssserver1 /var/www/html/wss/ is not found.

My nginx config

test 1 nginx config

location /wssserver1 {
  proxy_buffers 8 32k;
  proxy_buffer_size 64k;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header X-Client-Verify SUCCESS;
  proxy_set_header Host $proxy_host;
  proxy_set_header X-NginX-Proxy true;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
  proxy_pass https://wssserver1/;
  proxy_redirect off;
  proxy_buffering off;
  proxy_read_timeout 999999999;
}
chteow
  • 1
  • Should not it be `proxy_pass https://wssserver1/wss/;` and `proxy_set_header Connection $connection_upgrade;`? – IVO GELOV Feb 13 '23 at 08:17
  • Already solved, need to have another location /wss { proxy_pass https://wssserver1/wss }. proxy_set_header Connection $connection_upgrade <- $connection_upgrade not working for nginx 1.20 debian – chteow Feb 15 '23 at 03:57
  • Sorry, forgot to mention that it needs `map $http_upgrade $connection_upgrade { default upgrade; '' close; }` – IVO GELOV Feb 15 '23 at 08:17

0 Answers0