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

Side by Side Diff: modules/web/templates/adblockplus.org.conf.erb

Issue 29614555: #5020 - Bridge trivial legacy redirects to modern redirect service (Closed) Base URL: https://hg1/infrastructure
Patch Set: Created Nov. 21, 2017, 11:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « hiera/roles/web/redirect/eyeo.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # XSS and clickjacking prevention headers 1 # XSS and clickjacking prevention headers
2 2
3 set $csp_frame ""; 3 set $csp_frame "";
4 if ($uri ~ ^/(:?\w\w(_\w\w)?/)?(?:index|firefox|chrome|opera|android|internet-ex plorer|safari|yandex-browser|maxthon)?$|^/blog/) 4 if ($uri ~ ^/(:?\w\w(_\w\w)?/)?(?:index|firefox|chrome|opera|android|internet-ex plorer|safari|yandex-browser|maxthon)?$|^/blog/)
5 { 5 {
6 set $csp_frame "; frame-src www.youtube-nocookie.com;"; 6 set $csp_frame "; frame-src www.youtube-nocookie.com;";
7 } 7 }
8 add_header Content-Security-Policy "default-src 'self'; img-src * data:; style-s rc 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' $csp_ frame"; 8 add_header Content-Security-Policy "default-src 'self'; img-src * data:; style-s rc 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' $csp_ frame";
9 add_header X-Frame-Options "sameorigin"; 9 add_header X-Frame-Options "sameorigin";
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 set $lang $1; 101 set $lang $1;
102 } 102 }
103 103
104 # Google Play is not available in China, so we redirect them to the 104 # Google Play is not available in China, so we redirect them to the
105 # builds for download, see https://issues.adblockplus.org/ticket/3094 105 # builds for download, see https://issues.adblockplus.org/ticket/3094
106 if ($geoip_country_code = 'CN') 106 if ($geoip_country_code = 'CN')
107 { 107 {
108 set $adblock_browser_android_store $adblock_browser_android_download; 108 set $adblock_browser_android_store $adblock_browser_android_download;
109 } 109 }
110 110
111 if ($arg_link = "reporter_connect_issue") 111 if ($arg_link = "adblock_browser_android_store")
112 { 112 {
113 rewrite ^ /forum/? redirect; 113 rewrite ^ $adblock_browser_android_store? redirect;
114 } 114 }
115 if ($arg_link = "reporter_other_link") 115
116 {
117 rewrite ^ /forum/? redirect;
118 }
119 if ($arg_link = "firefox_support")
120 {
121 rewrite ^ /forum/viewforum.php?f=1? redirect;
122 }
123 if ($arg_link = "chrome_support")
124 {
125 rewrite ^ /forum/viewforum.php?f=10? redirect;
126 }
127 if ($arg_link = "opera_support")
128 {
129 rewrite ^ /forum/viewforum.php?f=14? redirect;
130 }
131 if ($arg_link = "safari_support")
132 {
133 rewrite ^ /forum/viewforum.php?f=18? redirect;
134 }
135 if ($arg_link = "edge_support")
136 {
137 rewrite ^ /forum/viewforum.php?f=27? redirect;
138 }
139 if ($arg_link = "knownIssuesChrome_filterstorage")
140 {
141 rewrite ^ /forum/viewtopic.php?t=23597? redirect;
142 }
143 if ($arg_link = "firefox_support")
144 {
145 rewrite ^ /forum/viewforum.php?f=1? redirect;
146 }
147 if ($arg_link = "adblock_browser_android_beta_community")
148 {
149 rewrite ^ https://plus.google.com/communities/104936844759781288661? redirec t;
150 }
151 if ($arg_link ~ "^adblock_browser_promotion_\d$") 116 if ($arg_link ~ "^adblock_browser_promotion_\d$")
152 { 117 {
153 rewrite ^ https://adblockplus.org/adblock-browser redirect; 118 rewrite ^ https://adblockplus.org/adblock-browser redirect;
154 } 119 }
155 if ($arg_link = "adblock_browser_android_support") 120
156 {
157 rewrite ^ /forum/viewforum.php?f=24? redirect;
158 }
159 if ($arg_link = "adblock_browser_android_faq")
160 {
161 rewrite ^ /forum/viewforum.php?f=24? redirect;
162 }
163 if ($arg_link = "adblock_browser_ios_support")
164 {
165 rewrite ^ /forum/viewforum.php?f=25? redirect;
166 }
167 if ($arg_link = "adblock_browser_android_store")
168 {
169 rewrite ^ $adblock_browser_android_store? redirect;
170 }
171 if ($arg_link = "adblock_browser_ios_store")
172 {
173 rewrite ^ https://geo.itunes.apple.com/us/app/adblock-browser-best-ad-blocke r/id1015653330?mt=8? redirect;
174 }
175 if ($arg_link = "adblock_browser_android_download") 121 if ($arg_link = "adblock_browser_android_download")
176 { 122 {
177 rewrite ^ $adblock_browser_android_download? redirect; 123 rewrite ^ $adblock_browser_android_download? redirect;
178 } 124 }
179 if ($arg_link = "adblock_plus_safari_ios_support")
180 {
181 rewrite ^ /forum/viewforum.php?f=26? redirect;
182 }
183 if ($arg_link = "adblock_plus_safari_ios_store")
184 {
185 rewrite ^ https://itunes.apple.com/app/adblock-plus-abp/id1028871868? redire ct;
186 }
187 if ($arg_link = "adblock_plus_sbrowser_store")
188 {
189 rewrite ^ https://play.google.com/store/apps/details?id=org.adblockplus.adbl ockplussbrowser? redirect;
190 }
191 if ($arg_link = "adblock_plus_chrome_dnt")
192 {
193 rewrite ^ https://support.google.com/chrome/answer/2790761? redirect;
194 }
195 if ($arg_link = "adblock_plus_firefox_dnt")
196 {
197 rewrite ^ https://www.mozilla.org/en-US/firefox/dnt/? redirect;
198 }
199 if ($arg_link = "adblock_plus_opera_dnt")
200 {
201 rewrite ^ http://help.opera.com/Windows/12.10/en/notrack.html? redirect;
202 }
203 if ($arg_link = "adblock_plus_edge_dnt")
204 {
205 rewrite ^ https://privacy.microsoft.com/en-us/windows-10-microsoft-edge-and- privacy? redirect;
206 }
207 if ($arg_link = "adblock_plus_report_bug")
208 {
209 rewrite ^ https://adblockplus.org/bugs#reporting? redirect;
210 }
211 if ($arg_link = "adblock_plus_report_ad")
212 {
213 rewrite ^ https://forums.lanik.us/viewforum.php?f=62? redirect;
214 }
215 125
216 set $forum_id "64"; 126 set $forum_id "64";
217 set $forum_link ""; 127 set $forum_link "";
218 if ($arg_link = "adblock_plus_report_issue") 128 if ($arg_link = "adblock_plus_report_issue")
219 { 129 {
220 set $forum_link "https://forums.lanik.us/viewforum.php?f="; 130 set $forum_link "https://forums.lanik.us/viewforum.php?f=";
221 } 131 }
222 if ($lang = "id") 132 if ($lang = "id")
223 { 133 {
224 set $forum_id "94"; 134 set $forum_id "94";
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 set $forum_id "91"; 166 set $forum_id "91";
257 } 167 }
258 if ($lang = "ru") 168 if ($lang = "ru")
259 { 169 {
260 set $forum_id "102"; 170 set $forum_id "102";
261 } 171 }
262 if ($forum_link != "") 172 if ($forum_link != "")
263 { 173 {
264 rewrite ^ $forum_link$forum_id? redirect; 174 rewrite ^ $forum_link$forum_id? redirect;
265 } 175 }
266 if ($arg_link = "releases")
267 {
268 rewrite ^ /releases? redirect;
269 }
270 if ($arg_link = "social_facebook")
271 {
272 rewrite ^ https://www.facebook.com/adblockplus? redirect;
273 }
274 if ($arg_link = "social_gplus")
275 {
276 rewrite ^ https://www.google.com/+AdblockPlus? redirect;
277 }
278 if ($arg_link = "social_renren")
279 {
280 rewrite ^ http://www.renren.com/601651969? redirect;
281 }
282 if ($arg_link = "social_twitter")
283 {
284 rewrite ^ https://twitter.com/adblockplus? redirect;
285 }
286 if ($arg_link = "social_weibo")
287 {
288 rewrite ^ http://e.weibo.com/adblockplus/? redirect;
289 }
290 176
291 set $link ""; 177 set $link "";
292 set $anchor ""; 178 set $anchor "";
293 179
294 if ($arg_link ~ "^share-") 180 if ($arg_link ~ "^share-")
295 { 181 {
296 set $link "share"; 182 set $link "share";
297 set $anchor "?a=minimal"; 183 set $anchor "?a=minimal";
298 } 184 }
299 if ($arg_link = "uninstalled") 185 if ($arg_link = "uninstalled")
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 location /403.html 316 location /403.html
431 { 317 {
432 try_files $uri @proxied; 318 try_files $uri @proxied;
433 } 319 }
434 location @proxied 320 location @proxied
435 { 321 {
436 proxy_pass https://server16.adblockplus.org; 322 proxy_pass https://server16.adblockplus.org;
437 proxy_set_header Host adblockplus.org; 323 proxy_set_header Host adblockplus.org;
438 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 324 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
439 } 325 }
OLDNEW
« no previous file with comments | « hiera/roles/web/redirect/eyeo.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld