OLD | NEW |
1 server { | 1 expires 31d; |
2 listen 80; | |
3 listen [::]:80; | |
4 server_name '<%= vhost %>'; | |
5 | 2 |
6 location / { | 3 root /usr/share/nagios3/htdocs; |
7 rewrite (.*) https://<%= vhost %>$1 permanent; | 4 index index.php index.html; |
8 } | 5 |
| 6 auth_basic "Nagios Restricted Access"; |
| 7 auth_basic_user_file /etc/nagios3/htpasswd.users; |
| 8 |
| 9 location /pnp4nagios { |
| 10 alias /usr/share/pnp4nagios/html; |
9 } | 11 } |
10 | 12 |
11 server { | 13 location ~ ^(/pnp4nagios.*\.php)(.*)$ { |
12 listen 443 ssl; | 14 root /usr/share/pnp4nagios/html; |
13 listen [::]:443 ssl; | 15 include /etc/nginx/fastcgi_params; |
14 ssl_certificate sites-available/adblockplus.org_sslcert.pem; | 16 fastcgi_split_path_info ^(.+\.php)(.*)$; |
15 ssl_certificate_key sites-available/adblockplus.org_sslcert.key; | 17 fastcgi_param PATH_INFO $fastcgi_path_info; |
16 | 18 |
17 server_name '<%= vhost %>'; | 19 fastcgi_param SCRIPT_FILENAME $document_root/index.php; |
| 20 fastcgi_pass unix:/tmp/php-fastcgi.sock; |
| 21 } |
18 | 22 |
19 expires 31d; | 23 location /stylesheets { |
| 24 alias /etc/nagios3/stylesheets; |
| 25 } |
20 | 26 |
21 root /usr/share/nagios3/htdocs; | 27 location ~ \.cgi$ { |
22 index index.php index.html; | 28 root /usr/lib/cgi-bin/nagios3; |
23 | 29 |
24 auth_basic "Nagios Restricted Access"; | 30 rewrite ^/cgi-bin/nagios3/(.*)$ /$1; |
25 auth_basic_user_file /etc/nagios3/htpasswd.users; | |
26 | 31 |
27 location /pnp4nagios { | 32 include /etc/nginx/fastcgi_params; |
28 alias /usr/share/pnp4nagios/html; | |
29 } | |
30 | 33 |
31 location ~ ^(/pnp4nagios.*\.php)(.*)$ { | 34 fastcgi_param AUTH_USER $remote_user; |
32 root /usr/share/pnp4nagios/html; | 35 fastcgi_param REMOTE_USER $remote_user; |
33 include /etc/nginx/fastcgi_params; | 36 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
34 fastcgi_split_path_info ^(.+\.php)(.*)$; | |
35 fastcgi_param PATH_INFO $fastcgi_path_info; | |
36 | 37 |
37 fastcgi_param SCRIPT_FILENAME $document_root/index.php; | 38 fastcgi_pass unix:/var/run/fcgiwrap.socket; |
38 fastcgi_pass unix:/tmp/php-fastcgi.sock; | 39 } |
39 } | |
40 | 40 |
41 location /stylesheets { | 41 location ~ \.php$ { |
42 alias /etc/nagios3/stylesheets; | 42 include /etc/nginx/fastcgi_params; |
43 } | 43 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
44 | 44 fastcgi_pass unix:/tmp/php-fastcgi.sock; |
45 location ~ \.cgi$ { | |
46 root /usr/lib/cgi-bin/nagios3; | |
47 | |
48 rewrite ^/cgi-bin/nagios3/(.*)$ /$1; | |
49 | |
50 include /etc/nginx/fastcgi_params; | |
51 | |
52 fastcgi_param AUTH_USER $remote_user; | |
53 fastcgi_param REMOTE_USER $remote_user; | |
54 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
55 | |
56 fastcgi_pass unix:/var/run/fcgiwrap.socket; | |
57 } | |
58 | |
59 location ~ \.php$ { | |
60 include /etc/nginx/fastcgi_params; | |
61 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
62 fastcgi_pass unix:/tmp/php-fastcgi.sock; | |
63 } | |
64 } | 45 } |
OLD | NEW |