Unable to use kubernetes terminal behind nginx because of CORS
I am running gitlab-ci behind an nginx-reverese-proxy. Everything works fine except for the webterminal, which always say "connection failure".
Workhorse's logfile shows
2017-04-01_07:36:51.68524 2017/04/01 09:36:51 Terminal: upgrading client to websocket failed: websocket: origin not allowed so I assume it's an CORS issue.
My nginx-config looks like this
location ~* /terminal.ws {
access_log off;
proxy_pass http://192.168.122.225:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header Origin "";
}
If I remove the Origin header using proxy_set_header Origin "";
everything works. But I suppose that's not a wise thing to do.
Is there a config-option for specifying origins, or is this a bug?