Page 1 of 1

Nagios XI R5 - REST API via HTTPS Manual Configuration

Posted: Thu Oct 15, 2015 5:21 pm
by mp4783
I have discovered (or perhaps I didn't configure properly although the documentation doesn't mention it), that a default Nagios XI R5.20 installation configured to also support HTTPS via the /etc/httpd/conf.d/ssl.conf file does not support the REST API for calls to the HTTPS URL. Calls to the HTTP URL work fine.

To resolve this, you need to put the following in /etc/httpd/conf.d/ssl.conf:

Code: Select all

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
</IfModule>
After restarting Apache, the REST API is now accessible via both HTTP and HTTPS. I admit that there might be a more elegant way to handle this.

Re: Nagios XI R5 - REST API via HTTPS Manual Configuration

Posted: Fri Oct 16, 2015 11:06 am
by jomann
You're correct we didn't add it to SSL. This is the correct way to get it working for SSL. We will make sure to add it into the 5.2.1 release and/or update the documentation accordingly.

Re: Nagios XI R5 - REST API via HTTPS Manual Configuration

Posted: Fri Oct 16, 2015 11:13 am
by lmiltchev
I filed an internal bug report (TASK ID 6654) already. Thanks!

Re: Nagios XI R5 - REST API via HTTPS Manual Configuration

Posted: Wed Nov 04, 2015 2:42 pm
by lmiltchev
FYI, I updated the "Nagios XI - Configuring SSL for Nagios XI" document:

https://assets.nagios.com/downloads/nag ... s%20XI.pdf