[SOLVED] Can't use the console when using Caddy as a proxy to PVE - NGINX works

xairoo

New Member
Nov 26, 2024
1
0
1
I just moved to Caddy, everthing that I proxy works, also the PVE UI, I just can't connect to the web terminals.

As fallback I use Cloudflare tunnel, this works also. It's just Caddy that won't let me use the console.

With Caddy I get undefined (Code: 1006) and timeouts for the terminals:
Code:
failed waiting for client: timed out
TASK ERROR: command '/usr/bin/termproxy 5900 --path /vms/102 --perm VM.Console -- /usr/bin/dtach -A /var/run/dtach/vzctlconsole102 -r winch -z lxc-console -n 102 -e -1' failed: exit code 1

Before I used NGINX and it worked.

Any ideas?

Caddy
Code:
    reverse_proxy https://127.0.0.1:50000 {
        transport http {
            tls_insecure_skip_verify
        }
        header_up Host {host}
        header_up X-Real-IP {remote_host}
        header_up X-Forwarded-For {remote_host}
        header_up X-Forwarded-Proto {scheme}
        header_up Upgrade {>Upgrade}
        header_up Connection {>Connection}
        header_up X-Forwarded-Port {server_port}
    }

NGINX
Code:
location / {
  proxy_pass https://127.0.0.1:50000;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
}

*update*
Fixed it, I had to remove:
Code:
        header_up Host {host}
        header_up X-Real-IP {remote_host}
        header_up X-Forwarded-For {remote_host}
        header_up X-Forwarded-Proto {scheme}
        header_up Upgrade {>Upgrade}
        header_up Connection {>Connection}
        header_up X-Forwarded-Port {server_port}

Still no idea why, but now it works.
 
Last edited: