You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: proxy by nginx websocket origin check error #6161
location~ ${your frontend url pattern}{ # add it if your url is dynamicresolver{your DNS server} # trick here, consult here for Nginx official docproxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection upgrade; # trick here, if absent, the server will block the websocket request if the origin is NOT equal to the hostproxy_set_header Origin http://${your backend host}/;proxy_set_header X-Forwarded-Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header Accept-Encoding gzip;proxy_cookie_domain ${your backend host} ${your frontend host};proxy_pass ${your backend url pattern};}
config above working for me. my scene:
code-server: 4.18.0, running in an container of Kubernetes
nginx:1.9.7, running in an container of another Kubernetes.
Activity
502647092 commentedon Apr 23, 2023
I fix it by modify nginx config
Origin Config
Modified
[-][Bug]: proxy by nginx origin check error[/-][+][Bug]: proxy by nginx websocket origin check error[/+]code-asher commentedon Apr 24, 2023
Oh interesting! We should make special exceptions for 443 and 80. #6166
mashroomxl commentedon Nov 12, 2023
try nginx config as follows:
config above working for me. my scene: