summaryrefslogtreecommitdiffstats
path: root/etc/nginx/site.conf
blob: 8d56aeb6d94cf68cd68a41dc1a2d3604a21a8d87 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# Nginx server configuration for the Nagios Plugins.
#
# See:
# 	/usr/share/doc/nginx-doc/examples
#
# 	http://wiki.nginx.org/Pitfalls
# 	http://wiki.nginx.org/QuickStart
# 	http://wiki.nginx.org/Configuration
#

#
# Server definition for <https://www.nagios-plugins.org/>.
#
server {
	listen 443 ssl;
	server_name www.nagios-plugins.org;
	root /home/plugins/web/site;

	#
	# Downloads and attachments.
	#
	location ^~ /attachments/ {
		root /home/plugins/web;
	}
	location ^~ /download/ {
		root /home/plugins/web;
		fancyindex on;
		fancyindex_exact_size off;
		fancyindex_css_href /media/plugins.css;
	}

	#
	# Mailman and cgit.
	#
	location ^~ /cgit {
		root /home/git/opt/cgit/web;
	}
	location ^~ /list/icons/ {
		alias /home/mailman/server/icons/;
	}
	location ~ ^/list/?$ {
		return 301 /list/listinfo;
	}
	location ~ ^/(?:list/|repositories) {
		root /home/plugins/web/cgi-bin;
		fastcgi_split_path_info ^(/list/[^/]+|/repositories)(.*)$;
		fastcgi_pass unix:/var/run/fcgiwrap.socket;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		fastcgi_param PATH_INFO $fastcgi_path_info;
		include /etc/nginx/fastcgi_params;
		gzip off; # Scripts have to complete before getting gzipped.
	}

	#
	# Redirects etc.
	#
	location = /favicon.ico {
		root /home/plugins/web/site/media;
	}
	location ^~ /snapshot {
		return 301 /download$request_uri;
	}
	location ~ ^/(?:man|guidelines$) {
		return 301 /doc$request_uri.html;
	}
}

#
# Redirect HTTP and all other domains to <https://www.nagios-plugins.org/>.
#
server {
	listen 80 default_server;
	listen 443 default_server ssl;
	return 301 https://www.nagios-plugins.org$request_uri;
}