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
After some debugging, I found the problem is that gorilla/websocket library by default checks whether the Host header matches the Origin header, and return a 403 Forbidden when they don't match. When using nginx, the Origin header is the external url, and the Host header is the address drone is listening on, so they differ and the browser get a 403 for websocket requests.
When drone is deployed behind nginx, the websocket support is broken even if nginx is configured as per http://readme.drone.io/setup/misc/nginx/
After some debugging, I found the problem is that gorilla/websocket library by default checks whether the Host header matches the Origin header, and return a 403 Forbidden when they don't match. When using nginx, the
Origin
header is the external url, and theHost
header is the address drone is listening on, so they differ and the browser get a 403 for websocket requests.The correspondent code is here .
A temporary hack is to set the origin header to an empty string in nginx configration, e.g:
The above hack works for me, but I hope we can find a more elegant solution for this.
The text was updated successfully, but these errors were encountered: