Access nagiosxi directly instead of https://<ip>/nagiosxi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
jithin@saturnme.com
Posts: 2
Joined: Thu Dec 05, 2024 5:58 am

Access nagiosxi directly instead of https://<ip>/nagiosxi

Post by jithin@saturnme.com »

I need to access Nagios XI directly, and the URL should be https://<ip>/ instead of https://<ip>/nagiosxi. Please let me know the steps to achieve this. We are using the latest version of Nagios XI.
User avatar
danderson
Posts: 224
Joined: Wed Aug 09, 2023 10:05 am

Re: Access nagiosxi directly instead of https://<ip>/nagiosxi

Post by danderson »

Thanks for reaching out

Unfortunately, right now, you won't be able to do this with the Neptune and Neptune Light themes. Modern and Modern Dark should work with this.

You need to modify the apache configuration to change the document root from whatever it is currently (most likely /var/www/html) to the html directory of nagiosxi (typically /usr/local/nagiosxi/html). On CentOS 9, the apache configuration is at /etc/httpd/conf/httpd.conf

Then you will have to modify the nagiosxi specific httpd configuration file. On CentOS 9 that's in /etc/httpd/conf.d/nagiosxi.conf. You will have to comment out the Alias /nagiosxi "/usr/local/nagiosxi/html" and also edit the mod_rewrite section. The original will say something like

Code: Select all

RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
RewriteRule nagiosxi/api/v2/(.*)$ /usr/local/nagiosxi/html/api/v2/index.php [QSA,NC,L]
and you have to change it to

Code: Select all

RewriteRule api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
RewriteRule api/v2/(.*)$ /usr/local/nagiosxi/html/api/v2/index.php [QSA,NC,L]
If you have SSL configured you'll also have to do the above change in the SSL conf file, which is at /etc/httpd/conf.d/ssl.conf on CentOS 9.

Then you will have to edit the nagiosxi config file. This is normally at /usr/local/nagiosxi/html/config.inc.php. You will change

Code: Select all

$cfg['base_url'] = "/nagiosxi";
to

Code: Select all

$cfg['base_url'] = "";
You should be able to access the user interface at this point. So you should then change the Program URL and External URL values in Admin -> System Config -> System Settings

Following these steps worked for me, so let me know if you run into any issues.
Post Reply