aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tasks/jail_homepage.yml8
-rw-r--r--templates/homepage/usr_local_etc_nginx_nginx.conf.j28
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;
}