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

Delta Between Two Patch Sets: modules/web/templates/adblockplus.org.conf.erb

Issue 29332588: Issue 3403 - Add web redirect for the uninstallation page (Closed)
Left Patch Set: Created Dec. 13, 2015, 5:22 p.m.
Right Patch Set: Renamed uninstall-abp uninstalled, added comment Created Dec. 14, 2015, 10:43 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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)?$) 4 if ($uri ~ ^/(:?\w\w(_\w\w)?/)?(?:index|firefox|chrome|opera|android|internet-ex plorer|safari|yandex-browser|maxthon)?$)
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 set $lang "en"; 165 set $lang "en";
166 set $link ""; 166 set $link "";
167 set $anchor ""; 167 set $anchor "";
168 168
169 if ($arg_link ~ "^share-") 169 if ($arg_link ~ "^share-")
170 { 170 {
171 set $link "share"; 171 set $link "share";
172 set $anchor "?a=minimal"; 172 set $anchor "?a=minimal";
173 } 173 }
174 if ($arg_link ~ "uninstalled") 174 if ($arg_link = "uninstalled")
Felix Dahlke 2015/12/14 10:23:26 Since you're not matching a regex, you can just us
kzar 2015/12/14 10:45:49 Done.
175 { 175 {
176 set $link "uninstall-abp"; 176 set $link "uninstalled";
177 } 177 }
178 if ($arg_link = "gettingStarted") 178 if ($arg_link = "gettingStarted")
179 { 179 {
180 set $link "getting_started"; 180 set $link "getting_started";
181 } 181 }
182 if ($arg_link = "faq") 182 if ($arg_link = "faq")
183 { 183 {
184 set $link "faq"; 184 set $link "faq";
185 } 185 }
186 if ($arg_link = "filterdoc") 186 if ($arg_link = "filterdoc")
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 set $lang "$1_$2"; 237 set $lang "$1_$2";
238 } 238 }
239 if (!-f "$document_root/$lang/$link") 239 if (!-f "$document_root/$lang/$link")
240 { 240 {
241 set $lang "en"; 241 set $lang "en";
242 } 242 }
243 if ($link = "share") 243 if ($link = "share")
244 { 244 {
245 rewrite ^ https://share.adblockplus.org/$lang/? redirect; 245 rewrite ^ https://share.adblockplus.org/$lang/? redirect;
246 } 246 }
247 if ($link = "uninstall-abp") 247 if ($link = "uninstalled")
248 { 248 {
249 rewrite ^ /$lang/$link$anchor redirect; 249 # For the uninstallation page we need to preserve the query parameters
kzar 2015/12/13 17:25:40 This is required because we want to preserve query
Felix Dahlke 2015/12/14 10:23:26 So you mean, this: https://adblockplus.org/redire
kzar 2015/12/14 10:45:49 Yep, although we've just agreed in IRC to rename u
Felix Dahlke 2015/12/14 11:21:16 Awesome, I was about to suggest that, but didn't b
Sebastian Noack 2015/12/14 12:38:37 We probably should strip the "link" parameter. Any
kzar 2015/12/14 12:44:11 Sure it's redundant but it doesn't harm. I couldn'
Felix Dahlke 2015/12/14 12:49:10 I thought about this as well, but AFAIK there's no
kzar 2015/12/14 12:59:12 My vote is to leave it as-is, it's simple and it w
Sebastian Noack 2015/12/14 13:17:25 Well, this certainly isn't something that would de
250 rewrite ^ /$lang/$link redirect;
250 } 251 }
251 rewrite ^ /$lang/$link$anchor? redirect; 252 rewrite ^ /$lang/$link$anchor? redirect;
252 } 253 }
253 254
254 location /devbuilds 255 location /devbuilds
255 { 256 {
256 rewrite ^(.*) https://downloads.adblockplus.org$1; 257 rewrite ^(.*) https://downloads.adblockplus.org$1;
257 } 258 }
258 259
259 # Locations still served by the legacy server 260 # Locations still served by the legacy server
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 location /403.html 306 location /403.html
306 { 307 {
307 try_files $uri @proxied; 308 try_files $uri @proxied;
308 } 309 }
309 location @proxied 310 location @proxied
310 { 311 {
311 proxy_pass https://server16.adblockplus.org; 312 proxy_pass https://server16.adblockplus.org;
312 proxy_set_header Host adblockplus.org; 313 proxy_set_header Host adblockplus.org;
313 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 314 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
314 } 315 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld