z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

HTTPS Redirect not working

This support forum board is for support questions relating to Nagios Network Analyzer, our network traffic and bandwidth analysis solution.

HTTPS Redirect not working

Postby Basher » Thu Feb 02, 2023 1:56 pm

I recently migrated my XI and NNA instances to new RHEL 8 systems. All is good on the XI front.

With NNA, though, I cannot get the HTTPS redirect to work on all URIs. If I browse to http://servername, or http://servername/nagiosna, it redirects. Any other URI does not.

SSL works if I update my browser's address bar (i.e. change http to https manually).

Code: Select all
[root@servername ~]# curl http://servername.localdomain
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://servername.localdomain/">here</a>.</p>
</body></html>

[root@servername ~]# curl http://servername.localdomain/nagiosna
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://servername.localdomain/nagiosna">here</a>.</p>
</body></html>

[root@servername ~]# curl http://servername.localdomain/nagiosna/login
<!DOCTYPE html>
<html>
<head>
    <!-- Produced by Nagios. Copyyright (c) 2013-2023 Nagios Enterprises, LLC (www.nagios.com). All Rights Reserved. -->
    <title>Login &bull; Nagios Network Analyzer</title>


This is code I currently have in /etc/httpd/conf.d/nagiosna.conf:
Code: Select all
# cat /etc/httpd/conf.d/nagiosna.conf
Alias /nagiosna "/var/www/html/nagiosna/www/"

<Directory "/var/www/html/nagiosna/www/">
  #SSLRequireSSL
   Options None
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|scripts|media|app|js|css|img|font|vendor|config.js)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule nagiosna/(.*)$ /var/www/html/nagiosna/www/index.php/$1 [L,QSA]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>


At the bottom of ssl.conf
Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|scripts|media|app|js|css|img|font|vendor|config.js)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule nagiosna/(.*)$ /var/www/html/nagiosna/www/index.php/$1 [L,QSA]
</IfModule>
</VirtualHost>


I'm getting no errors in any log. I've tried to correct this and am getting nowhere. Anyone have experience with this and NNA?
Basher
 
Posts: 3
Joined: Fri Jun 11, 2021 9:58 am

Re: HTTPS Redirect not working

Postby Basher » Fri Feb 24, 2023 10:33 am

Anyone have any experience with this? It seems like it's standard Apache configs that I'm missing.
Basher
 
Posts: 3
Joined: Fri Jun 11, 2021 9:58 am

Re: HTTPS Redirect not working

Postby Basher » Fri Feb 24, 2023 1:19 pm

I was able to figure this out.
Basher
 
Posts: 3
Joined: Fri Jun 11, 2021 9:58 am


Return to Nagios Network Analyzer

Who is online

Users browsing this forum: Fess [Nagios Bot] and 17 guests