Verified Commit 5d0c9d3b authored by Kristian Klausen's avatar Kristian Klausen 🎉
Browse files

mailman: Add map for redirecting migrated lists to the ml3 interface

parent 9d475948
...@@ -49,6 +49,10 @@ ...@@ -49,6 +49,10 @@
- name: make nginx log dir - name: make nginx log dir
file: path=/var/log/nginx/{{ lists_domain }} state=directory owner=root group=root mode=0755 file: path=/var/log/nginx/{{ lists_domain }} state=directory owner=root group=root mode=0755
- name: install nginx mailman2->mailman3 redirect map
copy: src=migrated-lists.map dest=/etc/nginx/maps/ owner=root group=root mode=0644
notify: reload nginx
- name: set up nginx - name: set up nginx
template: src=nginx.d.conf.j2 dest="/etc/nginx/nginx.d/mailman.conf" owner=root group=root mode=644 template: src=nginx.d.conf.j2 dest="/etc/nginx/nginx.d/mailman.conf" owner=root group=root mode=644
notify: reload nginx notify: reload nginx
......
...@@ -15,6 +15,10 @@ server { ...@@ -15,6 +15,10 @@ server {
} }
} }
map $uri $migrated_uri {
include maps/migrated-lists.map;
}
server { server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
...@@ -28,6 +32,10 @@ server { ...@@ -28,6 +32,10 @@ server {
ssl_certificate_key /etc/letsencrypt/live/{{ lists_domain }}/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/{{ lists_domain }}/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/{{ lists_domain }}/chain.pem; ssl_trusted_certificate /etc/letsencrypt/live/{{ lists_domain }}/chain.pem;
if ($migrated_uri) {
return 302 $migrated_uri;
}
# redirect old urls # redirect old urls
location /mailman/ { location /mailman/ {
rewrite ^/mailman/(.*) /$1 permanent; rewrite ^/mailman/(.*) /$1 permanent;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment