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

Side by Side Diff: modules/nginx/templates/site.erb

Issue 29408777: Issue 4894 - Block requests from mysterious adblocker that concentrates traffic on 21:00 UTC (Closed)
Patch Set: Created April 10, 2017, 8:26 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 | « no previous file | 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 <% include_file = lambda do |url| %> 1 <% include_file = lambda do |url| %>
2 <% content = Puppet::FileServing::Content.indirection.find(url) %> 2 <% content = Puppet::FileServing::Content.indirection.find(url) %>
3 <% if content %> 3 <% if content %>
4 <%= content.content %> 4 <%= content.content %>
5 <% else %> 5 <% else %>
6 <% raise StandardError, "Failed to resolve source URL #{url}" %> 6 <% raise StandardError, "Failed to resolve source URL #{url}" %>
7 <% end %> 7 <% end %>
8 <% end %> 8 <% end %>
9 9
10 <% server_name = lambda do |domain, alt_names| %><%= domain %><% @alt_names.each do |name| %>, <%= name %><% end %><% end %> 10 <% server_name = lambda do |domain, alt_names| %><%= domain %><% @alt_names.each do |name| %>, <%= name %><% end %><% end %>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 access_log /var/log/nginx/<%= log %> <%= log_format %>; 65 access_log /var/log/nginx/<%= log %> <%= log_format %>;
66 66
67 # redirect server error pages to the static page /50x.html 67 # redirect server error pages to the static page /50x.html
68 # 68 #
69 error_page 500 502 503 504 /50x.html; 69 error_page 500 502 503 504 /50x.html;
70 location = /50x.html 70 location = /50x.html
71 { 71 {
72 root /usr/share/nginx/html; 72 root /usr/share/nginx/html;
73 } 73 }
74 74
75 # https://issues.adblockplus.org/ticket/4894
76 location /easylistchina+easylist.txt
77 {
78 if ($http_user_agent = "")
79 {
80 return 400;
81 }
82 }
83
75 if ($http_host ~ "^(.+)\.$") 84 if ($http_host ~ "^(.+)\.$")
76 { 85 {
77 set $canonical_host $1; 86 set $canonical_host $1;
78 rewrite ^(.*) $scheme://$canonical_host$1 permanent; 87 rewrite ^(.*) $scheme://$canonical_host$1 permanent;
79 } 88 }
80 89
81 <% if @content %> 90 <% if @content %>
82 <%= content %> 91 <%= content %>
83 <% end %> 92 <% end %>
84 93
85 <% if @source %> 94 <% if @source %>
86 <% include_file[source] %> 95 <% include_file[source] %>
87 <% end %> 96 <% end %>
88 } 97 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld