pnp4nagios/sample-config/config_samples/apache.pnp4nagios.conf.in
2025-08-06 18:11:51 +02:00

39 lines
1.0 KiB
Plaintext

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
Alias @PNP_URL@ "@datarootdir@"
<Directory "@datarootdir@">
AllowOverride None
<IfVersion >= 2.3>
<RequireAll>
Require all granted
# Require host 127.0.0.1
</RequireAll>
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
</IfVersion>
#
# Use the same value as defined in nagios.cfg
#
AuthName "Nagios Access"
AuthType Basic
AuthUserFile @NAGIOS_PWD@
Require valid-user
<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On
Options symLinksIfOwnerMatch
# Installation directory
RewriteBase @PNP_URL@/
# Protect application and system files from being viewed
RewriteRule "^(?:application|modules|system)/" - [F]
# Allow any files or directories that exist to be displayed directly
RewriteCond "%{REQUEST_FILENAME}" !-f
RewriteCond "%{REQUEST_FILENAME}" !-d
# Rewrite all other URLs to index.php/URL
RewriteRule "^.*$" "index.php/$0" [PT]
</IfModule>
</Directory>