diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2026-01-02 16:13:57 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2026-01-02 16:13:57 +0200 |
| commit | 1b3a892b3a0af90ee7239b67eecb0d2f510aa0b9 (patch) | |
| tree | f975482161539e3243b9e1db48284c18fb4ce0a4 | |
| parent | 533bc95c751337d5f2952252b0378848cf078357 (diff) | |
Add homepage migration rules
| -rw-r--r-- | tasks/jail_homepage.yml | 8 | ||||
| -rw-r--r-- | templates/homepage/usr_local_etc_nginx_nginx.conf.j2 | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/tasks/jail_homepage.yml b/tasks/jail_homepage.yml index 161d02c..6751ad5 100644 --- a/tasks/jail_homepage.yml +++ b/tasks/jail_homepage.yml @@ -22,7 +22,7 @@ owner: root group: wheel mode: "0644" - register: nginx_conf + register: homepage_nginx_conf - name: Check if nginx is enabled shell: service -j homepage nginx status @@ -32,9 +32,9 @@ - name: Enable and start nginx shell: | - service -j homepage nginx enable - service -j homepage nginx onestart - when: homepage_nginx_enabled.rc != 0 + service -j ingress nginx enable + service -j ingress nginx restart + when: homepage_nginx_enabled.rc != 0 or homepage_nginx_conf.changed - name: Set up crontab template: diff --git a/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 b/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 index 53d1c31..7d029d2 100644 --- a/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 +++ b/templates/homepage/usr_local_etc_nginx_nginx.conf.j2 @@ -19,6 +19,14 @@ http { index index.html; + # Migration redirects from legacy site + location ~ ^/archive(?:/(.*))?$ { + return 302 /posts/$1$is_args$args; + } + location = /feed.xml { + return 302 /atom.xml; + } + location / { try_files $uri $uri.html $uri/ =404; } |
