Proxmox server as backend of apache reverse proxy

amado

New Member
Hello.
The first is to congratulate the team who have made this great server virtualization.
Second apologize for my bad English.
I have installed Proxmox behind a apache reverse proxy like this:

ServerName proxmox.xxxxx.xxxxx.xxx
ProxyRequests off
ProxyPreserveHost on
SSLProxyEngine on


ProxyPass / https://proxmox.xxxxx.dmz:8006/
ProxyPassReverse / https://proxmox.xxxxx.dmz:8006/


SSLCertificateFile /etc/ssl/certs/www.crt
SSLCertificateKeyFile /etc/ssl/private/www.key
SSLEngine on



The web access works but can not be accessed by non-vnc and spice to the virtual machines.


How could I set it up?


Thank you.
 
The trick is in the web socket handling.
You need the proxy_wstunnel apache module enabled,

Then besides the normal ProxyPass rules you need an extra rewrite rule set to handle the connection upgrade.
Code:
SSLProxyEngine on

ProxyPass / https://proxmoxhost.example.com:8006/ max=100
ProxyPassReverse / https://proxmoxhost.example.com:8006/

RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "wss://proxmoxhost.example.com:8006/$1" [P,L]