[Xymon] Change host using httphdr

Japheth Cleaver cleaver at terabithia.org
Tue May 14 16:30:08 CEST 2019


On 5/14/2019 12:08 AM, Sommerdal IT ApS wrote:
> I'm trying to access an internal ressource - trying to change the host 
> information in the http header.
>
> 192.168.29.11 <http://s.bl-1.com/h/c4MTgLWp?url=http://192.168.29.11> 
> internal-host.eu 
> <http://s.bl-1.com/h/c4MTgRvr?url=http://internal-host.eu>    #conn 
> https://internal-host.eu 
> <http://s.bl-1.com/h/c4MTgWJt?url=https://internal-host.eu> 
> httphdr="Host:external-host.com <http://external-host.com>"
>
> I end up with a 404, as the host isn't reconized.
> Any suggestion on how to imporve?
>
> Regards
> Leif
>

I suspect this will end up with two Host headers, which is probably 
going to result in undefined behavior. If external-host.com and 
internal-host.eu point to the same IP, you can simply write it as:

192.168.29.11 <http://s.bl-1.com/h/c4MTgLWp?url=http://192.168.29.11> 
internal-host.eu 
<http://s.bl-1.com/h/c4MTgRvr?url=http://internal-host.eu>   # conn 
https://external-host.eu/

The general way for overriding a Host header *and* specifying a given IP 
for that host (e.g., you're hitting all the traditional VirtualHosts a 
specific box is hosting, but on internal addresses) is:

192.168.29.11 <http://s.bl-1.com/h/c4MTgLWp?url=http://192.168.29.11> 
internal-host.eu 
<http://s.bl-1.com/h/c4MTgRvr?url=http://internal-host.eu>   # conn 
https://external-host.eu=192.168.29.11/

See "Testing sites by IP-address" in hosts.cfg.(5)

HTH,
-jc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20190514/7fb97717/attachment.html>


More information about the Xymon mailing list