wrfly / container-web-tty

Connect your containers via a web-tty
https://container-web-tty.kfd.me/
Apache License 2.0
246 stars 45 forks source link

behind proxy configuration #41

Closed liuhuiping2013 closed 4 years ago

liuhuiping2013 commented 4 years ago

i want use nginx to proxy this webserver, like this: proxy /env1 127.0.0.1:8080

this will have a lot of 404 page not found

wrfly commented 4 years ago

Can u paste the error logs in the web browser console?

liuhuiping2013 commented 4 years ago

Can u paste the error logs in the web browser console?

no error log, just http 404. proxy will request /env1/static/js, which path not in your route

this is an example of program behind proxy server: using external urls and proxies with prometheus

wrfly commented 4 years ago

I think it's the proxy config issue.

derray commented 4 years ago

for everybody behind a nginx proxy, this worked for me to get rid of the "connection closed" message:

server {
        ...
        location / {
                proxy_pass http://127.0.0.1:8080;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_read_timeout 86400;
        }
}
wrfly commented 4 years ago

yes, because websocket use HTTP2.