Inconsistent Behavior using Proxy Host with "Custom Locations" Feature (Lots of Pictures) #3775
Unanswered
MaximumPotato
asked this question in
Q&A
Replies: 1 comment
-
I had the exact same issue trying to configure a pihole proxy host. This is the way, and I 2nd the suggested wording changes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Today I set up some Proxy Hosts in conjunction with PiHole's DNS Records, so I'd be able to use some little URL's within my network rather than remember a bunch of IP addresses for things I have running. This has worked well for the most part, with things like my Octoprint Web UI being accessible from "octo.here".
There's an exception to this, however. The PiHole instance needs to be accessed in a browser specifically at "Local_IP:Port/admin". To this end I walked through the issue #104 comment thread, eventually learning how to properly use the "Custom Locations" feature I had seen but was unable to get working. Now I have a custom URL for the pihole, lets say "hole.here", which loads the page at "Local_IP:Port/admin".
The issue is that the first time I visit the PiHole login page in a browser and log in, I get redirected from "hole.here/login.php" to "hole.here/admin", which throws a 404 error. Taken literally I am guessing that this is trying to access "hole.here/admin/admin".
To get around this, I need to go into the URL bar and change the URL to "hole.here". This loads the PiHole UI as expected, and will always take me to the page as long as I am logged in.
If I log out, which sends me back to the PiHole login page, and then log in without leaving the page, I am logged in and sent to the PiHole homepage as I would expect. The only difference is that rather than the URL reading "hole.here", it reads "hole.here/index.php".
If I log out, and go to say google.com before going back to hole.here, I get a similar but slightly different 404 page where the URL reads "hole.here/admin/index.php" rather than "hole.here/admin" as it did a few images up.
Refreshing the page prior to logging back in (rather than visiting another website or logging in straight away) seems to have the same results as just logging back in; It works fine. This is the same regardless of if I do a normal refresh, or a CTRL+F5 refresh.
I am not sure how I would need to configure this to work properly every time, or if there is even a way to do so. I am guessing the behaviors I've documented above with the URL inconsistencies might have more to do with the inner workings of PiHole than anything NGINX is doing, but I lack the experience to say for sure. Any assistance in fixing this or in helping me undertstand what is going on would be greatly appreciated :-). Here's my Proxy Configuration for reference:
Note
This comment helped me realize that when working in the "Custom Locations" tab of a Proxy Host, the "Location" field wanted a single "/" rather than the IP address. It also made me realize that the the Forward Hostname field wanted the full IP/Address and folder rather than just the folder. Changing "Location" to "Directory", or adding "e.g. your root root folder" to as a tip under the location field and also adding a verbose "enter the full URL minus the Port" to the tip under "Forward Hostname / IP" would have helped wrangle my train of thought here. This is assuming my suggested language doesn't cause more confusion for people already more familiar with these concepts.
Beta Was this translation helpful? Give feedback.
All reactions