key-networks / ztncui

ZeroTier network controller UI
GNU General Public License v3.0
1.56k stars 230 forks source link

[Q] Reverse Proxy Subdirectory? #11

Closed soakes closed 5 years ago

soakes commented 6 years ago

I am trying to proxy this through a subdirectory but its links and css/images etc are all at the wrong URLS (uses base url without sub). Is there a flag you can give the path? http_path=/ztncui?

key-networks commented 6 years ago

Looking into this... it's not as simple as appears at first sight.

soakes commented 6 years ago

That's a shame, but thank you for looking at it.

I will see if I can knock up some clever rewrite rules which should do the same for now. In the meantime, I have this under a subdomain and works great. Thank you.

key-networks commented 5 years ago

Did you manage to sort this out with some rewrite rules? If so, would you mind sharing them?

itskenny0 commented 5 years ago

I’m fairly sure one could do this with the Caddy webserver and it’s proxy directive. It allows to proxy into a subdirectory without passing it to the backend using the ‘without’ argument. I could probably write an example config for this, but I’m on holiday this week.

Here’s the docs if someone wants to have a crack at it: https://caddyserver.com/docs/proxy

soakes commented 5 years ago

Some of the site wasn't working correctly, so it been thrown into a subdomain for now. I haven't had much more time to look/tweak rules since but I expect some rewrite rules likely would fix this. If/when I get some time to play, will investigate further.

I believe I did a test using 'without'. This was partly working but not fully. Will knock up some screenshots and that at the weekend and send your way if I get a few minutes.