Configuring nagiosxi to https redirect only

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
yunushaikh
Posts: 176
Joined: Sat Jun 20, 2015 9:04 pm

Configuring nagiosxi to https redirect only

Post by yunushaikh »

Hello Experts,

I have recently installed nagios xi enterprise.
I have default configuration as of now.
We have done the setting from AWS side and configured the ssl certificate from AWS itself.
Now if I open the nagios URL with http and https it works fine with both.
Requirement is now whenever there is any http request we want it directly to route to https.

Can anyone please help with what configurations needs to be done in nagios for redirecting the nagios url permanently to https even if http request is made.

Thanks a lot
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Configuring nagiosxi to https redirect only

Post by eloyd »

Assuming you have a working SSL (https) configuration (if not, then read this: https://assets.nagios.com/downloads/nag ... s%20XI.pdf) then the only thing you need to do is at the Apache level, redirect all non-SSL traffic to the SSL version.

Edit /etc/httpd/conf.d/ssl.conf and add these lines at the bottom to redirect http to https:

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/%$1 [R,L]
Now, all requests to http://<server>/nagiosxi/... will be redirected to https://<server>/nagiosxi/...
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Configuring nagiosxi to https redirect only

Post by dwhitfield »

Thanks @eloyd!

Are we ready to lock this up?
yunushaikh
Posts: 176
Joined: Sat Jun 20, 2015 9:04 pm

Re: Configuring nagiosxi to https redirect only

Post by yunushaikh »

Hey Thanks for suggestion.

You can close this thread
Locked