[SOLVED] Accessing the console via a proxy

thorinas

New Member
Mar 26, 2023
2
1
1
Hi I wonder if someone could help. iv got nginx proxy manager installed as a CT on my Proxmox server, I'm able to log into my server via a proxy i.e. mox.server.com but for some reason I'm unable to open the consoles and I'm keep getting error 1006, any idea what I'm missing?
 
Hi,

[ Haven't used nginx proxy manager before, just a disclaimer. ]

There is a guide on how to setup nginx as a proxy, additionally there is a separate guide in the forum for noVNC via a proxy. Although the latter is for Apache2, it should be relatively easy to translate that to nginx.

Basically: noVNC uses WebSockets and thus needs some special handling around using the correct protocol (which I assume nginx proxy manager doesn't do by default).

When looking at the Apache2 example, especially these lines are important:
Code:
<LocationMatch ^/(api2/json/nodes/[^\/]+/[^\/]+/[^\/]+/vncwebsocket.*)$>
    ProxyPass wss://10.1.1.1:8006/$1 retry=0
</LocationMatch>
  
<Location /websockify>
    ProxyPass ws://10.1.1.1:8006
    ProxyPassReverse ws://10.1.1.1:8006
</Location>

They ensure that requests/connections to the [..]/vncwebsocket and /websockify endpoints are properly passed on as secure WebSocket (wss://) connections.
 
Glad you could that solve this!

Please just mark the thread as solved by editing the first post - there should be a dropdown near the title field. This helps other people with the same problem to more easily find this thread in the future! :)
 
I've had the same problem. Please add this to the Proxy host that you've assigned to your proxmox-node. This worked for me :

Proxy Host > Advanced > Custom Nginx Configuration

Change the <IP-OF-HOST> to the IP address of your proxmox-node.

location / {
proxy_pass https://<IP-OF-HOST>:8006;
proxy_set_header 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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_buffering off;
}