summaryrefslogtreecommitdiffstats
path: root/etc/nginx/site.conf
diff options
context:
space:
mode:
Diffstat (limited to 'etc/nginx/site.conf')
-rw-r--r--etc/nginx/site.conf76
1 files changed, 76 insertions, 0 deletions
diff --git a/etc/nginx/site.conf b/etc/nginx/site.conf
new file mode 100644
index 0000000..8d56aeb
--- /dev/null
+++ b/etc/nginx/site.conf
@@ -0,0 +1,76 @@
1#
2# Nginx server configuration for the Nagios Plugins.
3#
4# See:
5# /usr/share/doc/nginx-doc/examples
6#
7# http://wiki.nginx.org/Pitfalls
8# http://wiki.nginx.org/QuickStart
9# http://wiki.nginx.org/Configuration
10#
11
12#
13# Server definition for <https://www.nagios-plugins.org/>.
14#
15server {
16 listen 443 ssl;
17 server_name www.nagios-plugins.org;
18 root /home/plugins/web/site;
19
20 #
21 # Downloads and attachments.
22 #
23 location ^~ /attachments/ {
24 root /home/plugins/web;
25 }
26 location ^~ /download/ {
27 root /home/plugins/web;
28 fancyindex on;
29 fancyindex_exact_size off;
30 fancyindex_css_href /media/plugins.css;
31 }
32
33 #
34 # Mailman and cgit.
35 #
36 location ^~ /cgit {
37 root /home/git/opt/cgit/web;
38 }
39 location ^~ /list/icons/ {
40 alias /home/mailman/server/icons/;
41 }
42 location ~ ^/list/?$ {
43 return 301 /list/listinfo;
44 }
45 location ~ ^/(?:list/|repositories) {
46 root /home/plugins/web/cgi-bin;
47 fastcgi_split_path_info ^(/list/[^/]+|/repositories)(.*)$;
48 fastcgi_pass unix:/var/run/fcgiwrap.socket;
49 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
50 fastcgi_param PATH_INFO $fastcgi_path_info;
51 include /etc/nginx/fastcgi_params;
52 gzip off; # Scripts have to complete before getting gzipped.
53 }
54
55 #
56 # Redirects etc.
57 #
58 location = /favicon.ico {
59 root /home/plugins/web/site/media;
60 }
61 location ^~ /snapshot {
62 return 301 /download$request_uri;
63 }
64 location ~ ^/(?:man|guidelines$) {
65 return 301 /doc$request_uri.html;
66 }
67}
68
69#
70# Redirect HTTP and all other domains to <https://www.nagios-plugins.org/>.
71#
72server {
73 listen 80 default_server;
74 listen 443 default_server ssl;
75 return 301 https://www.nagios-plugins.org$request_uri;
76}