summaryrefslogtreecommitdiffstats
path: root/roles/lists/files/etc/nginx
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-05-14 22:00:36 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:53:27 +0200
commit166804e99e33c8ec5760e88ba1f52d4fc301334c (patch)
tree706ca108db27e2e6f1c696bdd3f72e6d1f2ce5fa /roles/lists/files/etc/nginx
parent334b7604727810c02ecb8942f3753dee15466691 (diff)
Configure the list manager (Sympa).
Diffstat (limited to 'roles/lists/files/etc/nginx')
-rw-r--r--roles/lists/files/etc/nginx/sites-available/sympa62
1 files changed, 62 insertions, 0 deletions
diff --git a/roles/lists/files/etc/nginx/sites-available/sympa b/roles/lists/files/etc/nginx/sites-available/sympa
new file mode 100644
index 0000000..5887dd0
--- /dev/null
+++ b/roles/lists/files/etc/nginx/sites-available/sympa
@@ -0,0 +1,62 @@
+server {
+ listen 80;
+ listen [::]:80 ipv6only=on;
+
+ server_name lists.fripost.org;
+
+ access_log /var/log/nginx/lists.access.log;
+ error_log /var/log/nginx/lists.error.log info;
+
+ return 301 https://$host$request_uri;
+}
+
+
+server {
+ listen 443;
+ listen [::]:443 ipv6only=on;
+
+ server_name lists.fripost.org;
+
+ include ssl/config;
+ ssl_certificate /etc/nginx/ssl/lists.fripost.org.pem;
+ ssl_certificate_key /etc/nginx/ssl/lists.fripost.org.key;
+
+ location = / {
+ return 301 /sympa$args;
+ }
+
+ location ^~ /static-sympa/ {
+ alias /var/lib/sympa/static_content/;
+ }
+
+ location ^~ /sympa {
+ fastcgi_split_path_info ^(/sympa)(.*)$;
+ include fastcgi/params;
+
+ fastcgi_pass unix:/run/wwsympa.socket;
+ gzip off;
+ }
+
+ location ~* ^/([^/]+)/?$ {
+ return 301 /$1/sympa$args;
+ }
+ location ~* ^/([^/]+)/sympa(/.*)?$ {
+ set $vhost $1;
+
+ if (!-f /etc/sympa/$vhost/robot.conf) {
+ return 404;
+ }
+
+ fastcgi_split_path_info ^(/[^/]+/sympa)(.*)$;
+ include fastcgi/params;
+
+ fastcgi_pass unix:/run/wwsympa.socket;
+ gzip off;
+
+ fastcgi_param SERVER_NAME $vhost;
+ }
+
+ location / {
+ return 404;
+ }
+}