Proxypass with NagiosNA

This support forum board is for support questions relating to Nagios Network Analyzer, our network traffic and bandwidth analysis solution.
balothia
Posts: 68
Joined: Sun Dec 08, 2013 10:25 am

Re: Proxypass with NagiosNA

Post by balothia »

Yes you are correct, in form action I can see the nagiosna server ip address.
In the config file this is exactly what I can see.

// base url of site
$config['site_url'] = '//'.$_SERVER['HTTP_HOST'].'/nagiosna';

What needs to be updated here?

Thanks
Gautam
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Proxypass with NagiosNA

Post by jomann »

You'll need to set that to whatever your proxypass URL is going to be - basically this "site_url" variable is setting the links up for us so we do this:

site_url('sources')

will output http://<ip address>/nagiosna/index.php/sources

So if we change to:

$config['site_url'] = '//mynagiosnaserver/nagiosna';

you'll get http://mynagiosnaserver/nagiosna/index.php/sources
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
balothia
Posts: 68
Joined: Sun Dec 08, 2013 10:25 am

Re: Proxypass with NagiosNA

Post by balothia »

I am not sure that should be the case because if I hardcode the proxypass IP, then not sure i will be able to access the nagiosna server URL locally.

What about if I change it to:
$config['site_url'] = '/nagiosna';
So IP Address should automatically append here, it should be dynamic. Just a thought.

Thanks,
Gautam
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Proxypass with NagiosNA

Post by sreinhardt »

You are correct, this would likely force you to always connect via proxy pass. However if you do not wish to do that, your alterations will have to happen on the proxy pass server, and actually modify the html that is sent back to the client system. You can certainly try just /nagiosna, however due to php generating the links, this may cause a http:///nagiosna instead.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
balothia
Posts: 68
Joined: Sun Dec 08, 2013 10:25 am

Re: Proxypass with NagiosNA

Post by balothia »

I tried with REMOTE_ADDR option instead of HTTP_HOST, it didnt worked. But I found the answer, with the proxypass the Proxypass's host ipaddress was not getting passed which was confusing and PHP was picking the IP Address used to Proxypass, which is a NagiosNA server IP Address. The answer to this solution is ProxyPreserveHost, if we have this parameter on with proxypass, the proxypass configuration will just work fine.

I tested it and this is working fine for till now.

Thanks,
Gautam
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Proxypass with NagiosNA

Post by sreinhardt »

Cool, glad its working! Locking it up.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked