Created
October 20, 2015 22:01
-
-
Save badsyntax/5d14e8e1f8a590e7ba34 to your computer and use it in GitHub Desktop.
Working nagios3 nginx virtual host file for Ubuntu 14.04.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name nagios.domain.com; | |
| access_log /var/log/nginx/nagios.access.log; | |
| error_log /var/log/nginx/nagios.error.log info; | |
| expires 31d; | |
| root /usr/share/nagios3/htdocs; | |
| index index.php index.html; | |
| auth_basic "Nagios Restricted Access"; | |
| auth_basic_user_file /etc/nagios3/htpasswd.users; | |
| location /stylesheets { | |
| alias /etc/nagios3/stylesheets; | |
| } | |
| location / { | |
| try_files $uri $uri/ index.php /nagios; | |
| } | |
| location /nagios { | |
| alias /usr/local/nagios/share; | |
| } | |
| location ~ ^/nagios/(.*\.php)$ { | |
| alias /usr/local/nagios/share/$1; | |
| include /etc/nginx/fastcgi_params; | |
| fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| } | |
| location ~ \.cgi$ { | |
| root /usr/lib/cgi-bin/nagios3; | |
| rewrite ^/cgi-bin/nagios3/(.*)$ /$1; | |
| include /etc/nginx/fastcgi_params; | |
| fastcgi_param AUTH_USER $remote_user; | |
| fastcgi_param REMOTE_USER $remote_user; | |
| fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/nagios3$fastcgi_script_name; | |
| fastcgi_pass unix:/var/run/fcgiwrap.socket; | |
| } | |
| location ~ \.php$ { | |
| include /etc/nginx/fastcgi_params; | |
| fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment