Nagios XI R5 - REST API via HTTPS Manual Configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

Nagios XI R5 - REST API via HTTPS Manual Configuration

Post 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.
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

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

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

I filed an internal bug report (TASK ID 6654) already. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

FYI, I updated the "Nagios XI - Configuring SSL for Nagios XI" document:

https://assets.nagios.com/downloads/nag ... s%20XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked