Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/filterserver/files/site.conf

Issue 29408755: Redirect for more granular control of lists (Closed)
Patch Set: Adding documentation for the redirections Created April 10, 2017, 5:25 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/filterserver/files/site.conf
===================================================================
--- a/modules/filterserver/files/site.conf
+++ b/modules/filterserver/files/site.conf
@@ -3,3 +3,53 @@
charset utf-8;
gzip_static on;
default_type text/plain;
+
+
+### http://hub.eyeo.com/issues/444 for ZTE redirects
+### http://hub.eyeo.com/issues/496 for bento.de redirects
+set $use_alternative_resource_flags 0;
+
+if ($arg_addonName ~ ^([Mm]axthon)$)
+{
+ set $use_alternative_resource_flags "BROWSER";
+}
+
+if ($arg_addonName ~ ^(adblockplusie)$)
+{
+ set $use_alternative_resource_flags "IE";
+}
+
+if ($arg_application ~ ^(yowser|adblockbrowser)$)
+{
+ set $use_alternative_resource_flags "BROWSER";
+}
+
+if ($arg_addonName = "libadblockplus-android")
+{
+ set $use_alternative_resource_flags "ZTE";
+}
+
+if ($geoip_country_code = "DE")
+{
+ set $use_alternative_resource_flags "${use_alternative_resource_flags}+LOCATION";
+}
+
+if ($use_alternative_resource_flags = "BROWSER+LOCATION")
+{
+ rewrite ^/easylist\.(.+) /easylist_noelemhide.$1 redirect;
+ rewrite ^/easylistgermany\+easylist\.(.+) /easylistgermany_noelemhide+easylist_noelemhide.$1 redirect;
+ rewrite ^/easylistgermany\.(.+) /easylistgermany_noelemhide.$1 redirect;
+}
+
+if ($use_alternative_resource_flags = "IE+LOCATION")
+{
+ rewrite ^/easylist\.(.+) /easylist_noelemhide.$1 break;
+ rewrite ^/easylistgermany\+easylist\.(.+) /easylistgermany_noelemhide+easylist_noelemhide.$1 break;
+ rewrite ^/easylistgermany\.(.+) /easylistgermany_noelemhide.$1 break;
+}
+
+if ($use_alternative_resource_flags = "ZTE")
+{
+ rewrite ^/exceptionrules\.(.+) /exceptionrules-minimal.$1 break;
+}
+
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld