VMware Cloud Community
bofh0verl0rd
Contributor
Contributor
Jump to solution

host-client via nginx reverse proxy

So I am trying to figure out how to get this to work through a nginx reverse proxy.

Since my lab network is inaccessible from my corporate LAN, only web applications are accessible but I can't seem to get this to proxy through my nginx server, like I do with the rest of my applications.

1 Solution

Accepted Solutions
ksc
VMware Employee
VMware Employee
Jump to solution

Without some error logs (web browser's "network connection" debug tab / what are the error messages), I can only guess...

But there's one very easy guess. Is you nginx configured to forward websockets? Which Host Client uses extensively.
https://www.nginx.com/blog/websocket-nginx/

View solution in original post

4 Replies
ksc
VMware Employee
VMware Employee
Jump to solution

Without some error logs (web browser's "network connection" debug tab / what are the error messages), I can only guess...

But there's one very easy guess. Is you nginx configured to forward websockets? Which Host Client uses extensively.
https://www.nginx.com/blog/websocket-nginx/

bofh0verl0rd
Contributor
Contributor
Jump to solution

Thank you for pointing me in the right direction!

There is some additional settings that need to be in place as well, for those who come across this post later.

    location ^~ /vhost1 { # https://nginxserveraddress/vhost1 (will take you here)

        proxy_pass              https://serveripaddr/ui;

        proxy_http_version      1.1;

        proxy_set_header        Upgrade $http_upgrade;

        proxy_set_header        Connection "Upgrade";

        proxy_read_timeout      86400;

        proxy_set_header        Host $host;

        proxy_set_header        X-Real-IP $remote_addr;

        proxy_set_header        X-Forwarded-Server $host;

        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header        Authorization "";

        proxy_redirect          off;

    }

0 Kudos
Donuts_Server
Contributor
Contributor
Jump to solution

I just started a thread about proxy pass with apache >> ProxyPass Apache - Signed SSL - Can connect to login, but then says "Please Refresh Browser"

Can you give me some tips? I am able to reach login but then just says refresh browser... not even sure where to look for troubleshooting logs. looking into websocket now, but confused a bit.

0 Kudos
Donuts_Server
Contributor
Contributor
Jump to solution

While this thread seems to be dead, I just wanted to share thanks for getting me to move to NGinX it wasn't hard and it seems it was build for ProxyPass! But I found I could not proxypass

   proxy_pass              https://serveripaddr/ui;https://serveripaddr/ui;

Like you did as it requires folders underneath the /ui directory in the webroot.

As A workaround I moved the /ui files into the webroot @ /usr/lib/vmware/hostd/docroot/

But it might be better to just

proxy_pass              https://serveripaddr/ui;https://serveripaddr/


and then type manually


https://nginxserveraddress/vhost1https://nginxserveraddress/vhost1/ui/


NOTE the trailing slash, or it fails! I put in a feature request to symlink /sdk and any other files needed from outside /ui into /ui during installation so perhaps in the next update this won't be an issue.


Again, final guides aka ramblings can be found here @

ESXI HTML5 EMBEDDED HOST WEB CLIENT WITH NGINX PROXYPASS AND WEBSOCKET. – Free Software Servers

0 Kudos