0
Answered

Where does the hostname get pulled from?

gary.parr 7 months ago updated 7 months ago 2

So, this might be a really dumb question... but I'm going to ask it anyway.

Where exactly does the host name get pulled from?


I have FileRun on a linux box with two nics. One is on the DMZ and allows http traffic only. The other is on the LAN and allows ssh and a few other, including HTTP for testing.


I first tried to register FileRun by accessing it using the LAN name, which because of DNS search domains, I could get to with just http://filerun.  It yelled at me... something about can't register with a local name.  OK, that's fair. And also a reminder that I should register using the actual name it will be known by.


So... I setup a proxy in my firewalls WAF to point my shiny new install and everything looked good until I tried to log in.  When I did, it hung.  A check of the network traffic showed that even though all traffic requests were for https://server.domain.com the login POST was sent to the server's IP address.


Weird.


Even weirder, the apache logs show that the header was being passed correctly. Apache knew the request was coming in for https://server.domain.com but FileRun just didn't like that. I tried setting the host name explicitly in 000-default.conf for the apache site config but that didn't help.


I worked around the issue by adding a hard-coded base url as described in one of the posts on this forum, but the nerd in me wants to get to the bottom of this and figure out how/why it wasn't working the first time.


Thanks,

Gary


Answered

The hostname is picked from the HTTP request, from the URL you use in the browser. Some reverse proxies don't forward it though, unless configured to, in which case FileRun won't pick the right hostname.

The apache access logs were showing the correct URL in the request when this was happening. But, in an effort to re-create the issue I just took out the URL override and...  everything is still working correctly. My best guess is that something, somewhere, was cached when I first hit this issue. Heck, could have been a stuck HTML re-write on the proxy. Who knows. Anyway, all is good in the world again.


Thanks,

Gary