user nobody nobody; events { } http { include mime.types; default_type application/octet-stream; server { listen 80; server_name XXXXXXX; access_log /var/log/nginx/nagios-access.log; error_log /var/log/nginx/nagios-error.log; auth_basic "Private"; auth_basic_user_file /usr/local/nagios/htpasswd.users; root /usr/local/nagios/share; index index.php index.html; 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; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~ \.cgi$ { root /usr/local/nagios/sbin/; rewrite ^/nagios/cgi-bin/(.*)\.cgi /$1.cgi break; fastcgi_param AUTH_USER $remote_user; fastcgi_param REMOTE_USER $remote_user; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; } ######################################################### Optativo!, solo si está instalado PNP4Nagios location /pnp4nagios { alias /usr/local/pnp4nagios/share; } location ~ ^(/pnp4nagios.*\.php)(.*)$ { root /usr/local/pnp4nagios/share/; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_pass unix:/var/run/php5-fpm.sock; } ######################################################### } }