Reverse proxy: Start / Stop VMs and xterm.js not working

Andreas Piening

Well-Known Member
Mar 11, 2017
81
12
48
44
I'm using a reverse proxy to expose the PVE web interface at https://localhost:8006 so that it is reachable at pve1.bastionhost.com. I can log into the web interface, create VMs and edit settings, but when click on the Start or Shutdown buttons for an active VM I get the error message "Connection error - server offline?" right after the confirmation dialog. When I check the request with the browsers dev tools, I can see a request to https://pve.bastionhost.com/api2/extjs/nodes/pve1/qemu/102/status/shutdown with the following response:
JSON:
{"status":501,"data":null,"success":0,"message":"Method 'GET /nodes/pve1/qemu/102/status/shutdown' not implemented"}

When I try to open the console with xterm.js on a running VM I get a red bar on top of the console canvas saying "Connection failed (Error 501: )" and I can see a POST request to https://pve.bastionhost.com/api2/json/nodes/pve1/termproxy with the response:
JSON:
{"data":null}

When I access the PVE web interface directly, everything is working fine. But I can't figure out why the reverse proxy is causing this issue, especially because I had this working without issues before.

Every hint on debugging or solving this issue is greatly appreciated.
 
Thank you @Moayad but I'm not using Nginx. I took a look at the wiki page anyways, in case there is something mentioned that may relate to my issue.
I'm using Teleport (https://goteleport.com/) as a reverse proxy. I do understand, that the fact that the xterm.js terminal and the Start / Shutdown operations do work when I access the PVE web interface directly indicated an issue with the reverse proxy setup and not with PVE. Since my reverse proxy setup is generally working fine for different web interfaces, including PVE, there has to be something specific that is causing this issue with xterm.js and start / shutdown.
I'm just hoping for someone to stumble upon this post who had the same or a similar issue.
If I find a solution elsewhere, I'll update this thread.
 
Last edited:
I did figure out that when using Nginx as a reverse proxy and then configure the Nginx port for the Application in Teleport instead of the Proxmox web interface directly, it does work. But I did this just as a test to confirm that this is a Teleport issue and not related to Proxmox. I don't want to have Nginx instances running on all my PVE instances just because of a Teleport bug.
After a while I did an upgrade to Teleport version 12.0.2 and the issue was solved. I had no issues since then. But it looks like this issue has been reintroduced in one of the latest releases, which is very unfortunate.
I'll be hoping for a teleport update to fix this issue once again.
 
thanks for all your inputs.

Can you let me know how you did that with Nginx ? I actually use traefik as an interface between teleport and my proxmox so this could work for me.

if you know if à GitHub issue let me know as well I could describe my problem there to help. I couldn’t find one.
 
Just in case you missed my message, would you be able to let me know what you did to make it work with Nginx in between ? I've tried many combination (I'm using Traefik) and can't figure it out. Not sure what I could be missing
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!