summaryrefslogtreecommitdiff
path: root/templates/nginx/nagios_nginx.conf
blob: 10a4be3a2ad4b45d49db09168d68d8bad06a61fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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;
        }
    }
}