summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2018-11-10 11:52:30 +0000
committerintrigeri <intrigeri@boum.org>2018-11-10 11:52:30 +0000
commit374233457ca0da19e8adbdc935ad49df13d571b0 (patch)
treee0188c03d2d08fb9e6bfc8e74fc77c1fd4da5c2c
parent70a119ae3bedb75281c47d855bce3a3b55d83a4d (diff)
Website: fix rewrite rules for feeds (refs: #14588)
The previous version caused an infinite redirect loop from the English version of these feeds to itself.
-rw-r--r--manifests/website/webserver/instance.pp2
-rw-r--r--templates/website/nginx/rewrite_rules.conf.erb (renamed from files/website/rewrite_rules.conf)6
2 files changed, 5 insertions, 3 deletions
diff --git a/manifests/website/webserver/instance.pp b/manifests/website/webserver/instance.pp
index 009bd10..90866f6 100644
--- a/manifests/website/webserver/instance.pp
+++ b/manifests/website/webserver/instance.pp
@@ -39,7 +39,7 @@ define tails::website::webserver::instance (
}
nginx::included { 'tails_website_rewrite_rules':
- source => 'puppet:///modules/tails/website/rewrite_rules.conf',
+ content => template('tails/website/nginx/rewrite_rules.conf.erb'),
}
file { $log_dir:
diff --git a/files/website/rewrite_rules.conf b/templates/website/nginx/rewrite_rules.conf.erb
index 76d4fa6..88e2f5a 100644
--- a/files/website/rewrite_rules.conf
+++ b/templates/website/nginx/rewrite_rules.conf.erb
@@ -5,6 +5,8 @@
# - https://nginx.org/en/docs/http/ngx_http_core_module.html#location
# - https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite
+<%- po_slave_lang_codes_regexp = '(?:' + @po_slave_languages.keys.join('|') + ')' -%>
+
rewrite ^/administration_password/?$ /doc/first_steps/startup_options/administration_password permanent;
rewrite ^/blueprint/additional_software_packages_offline_mode/?$ /blueprint/additional_software_packages/offline_mode permanent;
rewrite ^/blueprint/tails-greeter:_revamp_UI/?$ /blueprint/greeter_revamp_UI permanent;
@@ -30,9 +32,9 @@ rewrite ^/git/?$ /contribute/git permanent;
rewrite ^/GnuPG_key/?$ /doc/about/openpgp_keys permanent;
rewrite ^/license/?$ /doc/about/license permanent;
rewrite ^/news/Call_for_help:_improve_the_infrastructure_behind_Tails/?$ /news/improve_the_infrastructure_behind_Tails permanent;
-rewrite ^/news/index\.[a-z]+\.(atom|rss)$ /news/index.en.$1 permanent;
+rewrite ^/news/index\.<%= po_slave_lang_codes_regexp %>\.(atom|rss)$ /news/index.en.$1 permanent;
rewrite ^/promote/(.*) /contribute/how/promote/material/$1 permanent;
-rewrite ^/security/index\.[a-z]+\.(atom|rss)$ /security/index.en.$1 permanent;
+rewrite ^/security/index\.<%= po_slave_lang_codes_regexp %>\.(atom|rss)$ /security/index.en.$1 permanent;
rewrite ^/support/truecrypt/?$ /doc/encryption_and_privacy/veracrypt permanent;
rewrite ^/support/virtualization/?$ /doc/advanced_topics/virtualization permanent;
rewrite ^/support/walkthrough/?$ /doc permanent;