1

I'm attempting to set up Apache to reverse proxy a Tensorboard server so I can view training progress over the web at my website, example.com. I decided to mess with two ways of implementing this: 1) creating a subdomain log.example.com and having Apache pass requests to this domain through to the server or 2) simply having Apache reverse proxy the server when example.com/tensorboard is visited. After testing both, only the first approach appears to work correctly.

The Tensorboard server is running on port 6006 of my server machine. Here are my Apache config files for the aforementioned approaches:

1) using the subdomain log.example.com

<VirtualHost *:80>
        ServerName log.example.com
        ProxyPreserveHost On

        <Directory /path/to/needed/files>
                Require all granted
        </Directory>

        ProxyPass / http://127.0.0.1:6006/
        ProxyPassReverse / http://127.0.0.1:6006/
</VirtualHost>

This works as expected. The Tensorboard server loads and displays graphs correctly.

2) using example.com/tensorboard

<VirtualHost *:80>
        ServerName example.com
        ProxyPreserveHost On

        <Directory /path/to/needed/files>
                Require all granted
        </Directory>

        <Location /tensorboard>
                ProxyPass http://127.0.0.1:6006/
                ProxyPassReverse http://127.0.0.1:6006/
        </Location>
</VirtualHost>

This does not work as expected. A template page does load from Tensorboard, but it never gets any further than that; it's always stuck attempting to load any of the expected graphs.

Because the first method works, I assume the problem doesn't lie with my Tensorboard server. I can't understand why both of these approaches don't work the exact same way; any ideas on what's going wrong with my second approach here?

sam
  • 111
  • 2
  • The problem is that the ProxyPass does not rewrite content and if the HTML code of your tensorboard application links for instance to `/css/style.css` and `/graphs/graph.png` those requests will go to `example.com/css/style.css` and they won't be proxied but handled by the main server - See my longer answer here: https://serverfault.com/a/561897/37681 – HBruijn Jun 12 '18 at 15:36
  • @HBruijn I see, that makes a lot of sense. Linked answer is great, thanks – sam Jun 12 '18 at 16:15
  • Yes i ran into this issue proxying esxi html5 web interface. Now i always do subdomain vs domain.com/proxyurl. A wild card SSL cert is about 100$ a year which I have, works great! – FreeSoftwareServers Jun 27 '18 at 08:08

0 Answers0