From 142820653f8d6a3fffacc9acde09ca74e22892bf Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 19 Sep 2017 17:55:40 +0200 Subject: Finished adding nagios policy along with simple nginx policy --- templates/nginx/nagios_nginx.conf | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 templates/nginx/nagios_nginx.conf (limited to 'templates/nginx/nagios_nginx.conf') diff --git a/templates/nginx/nagios_nginx.conf b/templates/nginx/nagios_nginx.conf new file mode 100644 index 0000000..10a4be3 --- /dev/null +++ b/templates/nginx/nagios_nginx.conf @@ -0,0 +1,59 @@ +worker_processes 1; + +# This default error log path is compiled-in to make sure configuration parsing +# errors are logged somewhere, especially during unattended boot when stderr +# isn't normally logged anywhere. This path will be touched on every nginx +# start regardless of error log location configured here. See +# https://trac.nginx.org/nginx/ticket/147 for more info. +# +#error_log /var/log/nginx/error.log; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + keepalive_timeout 65; + gzip on; + + server { + listen 80; + server_name localhost; + + root /usr/local/www/nagios/; + auth_basic "Restricted"; + auth_basic_user_file /usr/local/etc/nginx/htpasswd; + + location / { + index index.php; + try_files $uri $uri/ index.php; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/local/www/nginx-dist; + } + location ~ \.php$ { + fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; + fastcgi_index index.php; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + fastcgi_pass_header Authorization; + } + + location ~ \.cgi$ { + include fastcgi_params; + fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param REMOTE_USER $remote_user; + } + } +} -- cgit v1.2.3