External Apache2 reverse proxy -> "Failed to connect" browser console.

CloudFlare pointing to my external IP address on esxi.domain.tld I've been googling this issue quite a bit, and have yet to find any solution. When I visit my ESXi UI via LAN, everything works great. But when running off Reverse Proxy it fails. I saw a few posts saying that a few different [902, 903, 7343] need to be port forwarded so I did that, and the issue persists. I am also getting WebSocket error 500 in Google Chrome console, but am unable to find any solid information on why it's giving 500.

Any help would be greatly appreciated, here's a bit of my setup and issue.

My webproxy config:

<VirtualHost *:80>

        ServerName esxi.domain.tld

        Redirect permanent / https://esxi.domain.tld


<VirtualHost *:443>

        ServerName esxi.domain.tld

        ServerAdmin me@domain.tld

        SSLProxyEngine on

        SSLProxyVerify none

        SSLProxyCheckPeerCN off

        SSLProxyCheckPeerName off

        SSLProxyCheckPeerExpire off

        ProxyRequests Off

        ProxyPreserveHost On

        RewriteEngine on

        RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]

        RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]

        RewriteRule .* ws://{REQUEST_URI} [P]

        ProxyPass /sdk/

        ProxyPassReverse /sdk/

        ProxyPass /ticket/ wss://

        ProxyPassReverse /ticket/ wss://

        ProxyPassMatch ^(/screen.*)$$1

        ProxyPass / retry=1 keepalive=On

        ProxyPassReverse /

        RequestHeader set X-Forwarded-HTTPS "0"

        Include /etc/letsencrypt/options-ssl-apache.conf

        SSLCertificateFile /etc/letsencrypt/live/esxi.domain.tld/fullchain.pem

        SSLCertificateKeyFile /etc/letsencrypt/live/esxi.domain.tld/privkey.pem



0 Kudos
2 Replies

Issue persists, any support would be greatly appreciated. Thanks.

0 Kudos


1] redirect rules

To access to your esxi web console through apache proxy you need to redirect the trafic as you did (solve the 404 error)

#proxy configuration

ProxyPreserveHost On

SSLProxyEngine On

#Redirect wss trafic

ProxyPass /ticket/ wss://{esxiIPOrName}/ticket/

ProxyPassReverse /ticket/ wss://{esxiIPOrName}/ticket/

"Redirect web trafic

ProxyPass / https://{esxiIPOrName}/

ProxyPassReverse /  https://{esxiIPOrName}/

2] enable ws tunel module

You need also to enable WS tunel in apache (in addition to mod proxy) to solve the error 500 :

a2enmod proxy_wstunnel

Then you need to restart apache and this worked for me.

I hope it will helps.


0 Kudos