Quick Reverse Proxy Question...

Started by Hoe, March 19, 2021, 12:44:37 AM

Previous topic - Next topic
Hey guys,

I have NGNIX running a reverse proxy for my Pi-Hole amongst other things but it's a good example, Pi-Hole listens on... /admin

This annoys my OCD lol, and I wanted to know if I can use the URL Rewrite Function to effectively remove the need for the /admin, so instead of needing to use...

https://pi-hole.domain.com/admin

I would only need to use...

https://pi-hole.domain.com/

I know it's silly, pointless and almost an entire waste of time, but I like learning and playing but not really sure where to start with this one.

Thanks

Have you tried a location block like:

location / {
    proxy_pass http://PIHOLE_IP/admin/;
}

March 20, 2021, 09:22:42 PM #2 Last Edit: March 20, 2021, 09:24:47 PM by Hoe
No but I am not sure how I would do that in the NGINX Config either, there is no proxy pass field per say...

Any idea how I would go about doing that in the OPNsense config I don't have a code block like that. I tried using /admin in Path Prefix which seemed logical but it didn't work.



Thanks

I don't use the nginx plugin myself, but that would have been my guess too

Can you see what is being written in /usr/local/etc/nginx/nginx.conf when that configuration is included in the GUI? That may help to refine what should be in the GUI. Also try a trailing slash in Path Prefix, ie /admin/

The location block that I put above works on my nginx reverse proxy (running on a Linux host) for pi-hole

proxy_pass is done via the upsteram servers. Did you regenerate the config and restart after changing the parameters?