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 • 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?