Page 1 of 1

How to Disable HTTPS on XI?

Posted: Tue Jan 08, 2019 10:27 pm
by axvers
Hello XI support,

We installed XI with https enabled at first time.

But our client ask us to disable https; they want to connect through http only.

And I tried to find some settings on XI Web UI, like "/Admin/System settings", found nothing relative.

Is there any way to disable https on UI?

OR, we need to modify some config file such as "config.inc.php" or "ssl.conf" to achieve this?

Thanks!


System Info:
- CentOS 7, 64 bit
- VM
- pure Nagios XI installed, no other apps (even nginx)

Re: How to Disable HTTPS on XI?

Posted: Wed Jan 09, 2019 11:22 am
by benjaminsmith
Hello @axvers,

By default, Nagios XI doesn't force the use of SSL. Go to Admin > System Settings > General Program Settings and make sure the Program URL is not set for https.

Also, there is a configuration setting for force https in /usr/local/nagiosxi/html/config.inc.php. Make sure that is set to false.

Code: Select all

// Force http/https
$cfg['use_https'] = false; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP
Let me know if you have any other questions. Thanks.

Re: How to Disable HTTPS on XI?

Posted: Mon Jan 14, 2019 10:04 pm
by axvers
Hello,

It turned out that these settings are not working.

The XI site still auto-connect over https (image 002).

We changed the Admin > System Settings > General Program Settings (image 001)
and
/usr/local/nagiosxi/html/config.inc.php. (image 004)

, then restart httpd.

Is there any other settings need to be modified?

Thanks!

Re: How to Disable HTTPS on XI?

Posted: Tue Jan 15, 2019 11:24 am
by lmiltchev
In addition to what you already did, do the following:

1. Open the /etc/httpd/conf.d/ssl.conf file in a text editor, and change these two lines:

Code: Select all

SSLCertificateFile /usr/local/nagiosxi/var/certs/nagiosxi.crt
SSLCertificateKeyFile /usr/local/nagiosxi/var/certs/nagiosxi.key
to these:

Code: Select all

SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
Go to the bottom of the file, and remove (or comment out) this section:

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>
Save and exit.

2. Open the /etc/httpd/conf.d/nagiosxi.conf file in a text editor, and change this:

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]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
to this:

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>
Save and exit.

3. Restart apache:

Code: Select all

service httpd restart
Let us know if this helped. Thank you!

Re: How to Disable HTTPS on XI?

Posted: Thu Jan 17, 2019 8:56 pm
by axvers
Hi Support,

It worked like a charm!

Thank you very much!

Re: How to Disable HTTPS on XI?

Posted: Fri Jan 18, 2019 9:43 am
by lmiltchev
I am glad I could help! :)