summaryrefslogtreecommitdiffstats
path: root/etc/nginx.conf
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-10-19 23:10:05 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-10-19 23:10:05 (GMT)
commit36a15b629005b293123043882e8b2c970a99f8b7 (patch)
treea3bea17d34a871059543fd90b758ab12aa4d7be0 /etc/nginx.conf
parentb3df8803c99104aedb24970841c4c8e8bd7ed99f (diff)
downloadsite-36a15b629005b293123043882e8b2c970a99f8b7.tar.gz
Let Nginx listen on specific IP address
Let Nginx listen on 130.133.8.40 instead of 0.0.0.0, and allow for serving additional SSL domains.
Diffstat (limited to 'etc/nginx.conf')
-rw-r--r--etc/nginx.conf98
1 files changed, 98 insertions, 0 deletions
diff --git a/etc/nginx.conf b/etc/nginx.conf
new file mode 100644
index 0000000..4c74584
--- /dev/null
+++ b/etc/nginx.conf
@@ -0,0 +1,98 @@
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 130.133.8.40:443 ssl;
17 listen 130.133.8.40:444 ssl;
18 server_name www.nagios-plugins.org;
19 ssl_certificate /home/plugins/etc/ssl/nagios-plugins.crt;
20 ssl_certificate_key /home/plugins/etc/ssl/nagios-plugins.key;
21 root /home/plugins/web/port-$server_port;
22
23 #
24 # Downloads and attachments.
25 #
26 location ^~ /attachments/ {
27 root /home/plugins/web;
28 }
29 location ^~ /download/ {
30 root /home/plugins/web;
31 fancyindex on;
32 fancyindex_exact_size off;
33 fancyindex_css_href /resources/plugins.css;
34 }
35
36 #
37 # Mailman and cgit.
38 #
39 location ^~ /cgit {
40 root /home/git/opt/cgit/web;
41 }
42 location ^~ /list/icons/ {
43 alias /home/mailman/server/icons/;
44 }
45 location ~ ^/list/?$ {
46 return 301 /list/listinfo;
47 }
48 location ~ ^/(?:list/|repositories) {
49 root /home/plugins/web/cgi-bin;
50 fastcgi_split_path_info ^(/list/[^/]+|/repositories)(.*)$;
51 fastcgi_pass unix:/var/run/fcgiwrap.socket;
52 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
53 fastcgi_param PATH_INFO $fastcgi_path_info;
54 include /etc/nginx/fastcgi_params;
55 gzip off; # Scripts have to complete before getting gzipped.
56 }
57
58 #
59 # Redirects etc.
60 #
61 location = /favicon.ico {
62 root /home/plugins/web/site/resources;
63 }
64 location = /doc/release-notes/1-5.html {
65 return 301 /news/release-1-5.html;
66 }
67 location = /download/snapshot/nagios-plugins-HEAD.tar.gz {
68 return 301 /download/snapshot/nagios-plugins-master.tar.gz;
69 }
70 location = /taxonomy/term/2 {
71 return 301 /doc/presentation.html;
72 }
73 location ^~ /snapshot {
74 return 301 /download$request_uri;
75 }
76 location ~ ^/(?:man.*|guidelines|extra-opts)$ {
77 return 301 /doc$request_uri.html;
78 }
79}
80
81#
82# Redirect HTTP and all other domains to <https://www.nagios-plugins.org/>.
83# Ditto for the test instance.
84#
85server {
86 listen 130.133.8.40:80 default_server;
87 listen 130.133.8.40:443 default_server ssl;
88 ssl_certificate /home/plugins/etc/ssl/nagios-plugins.crt;
89 ssl_certificate_key /home/plugins/etc/ssl/nagios-plugins.key;
90 return 301 https://www.nagios-plugins.org$request_uri;
91}
92server {
93 listen 130.133.8.40:81 default_server;
94 listen 130.133.8.40:444 default_server ssl;
95 ssl_certificate /home/plugins/etc/ssl/nagios-plugins.crt;
96 ssl_certificate_key /home/plugins/etc/ssl/nagios-plugins.key;
97 return 301 https://www.nagios-plugins.org:444$request_uri;
98}