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

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

Issue 29538581: #3421 - Do root rewrite before rewriting to translated page (Closed) Base URL: https://hg1/infrastructure
Left Patch Set: Created Sept. 7, 2017, 8:41 a.m.
Right Patch Set: more details in commit msg Created Sept. 11, 2017, 8:48 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 root /var/www/<%= @vhost %>; 1 root /var/www/<%= @vhost %>;
2 index index; 2 index index;
3 default_type text/html; 3 default_type text/html;
4 charset utf-8; 4 charset utf-8;
5 5
6 set $index_page "index"; 6 set $index_page "index";
7 7
8 <% if @custom_config %> 8 <% if @custom_config %>
9 <%= @custom_config %> 9 <%= @custom_config %>
10 <% end %> 10 <% end %>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 { 48 {
49 rewrite ^(.*) /$preferredLang$1 last; 49 rewrite ^(.*) /$preferredLang$1 last;
50 } 50 }
51 if (-e "$document_root/en$uri") 51 if (-e "$document_root/en$uri")
52 { 52 {
53 rewrite ^(.*) /en$1 last; 53 rewrite ^(.*) /en$1 last;
54 } 54 }
55 55
56 } 56 }
57 57
58 # http://hub.eyeo.com/issues/3299 Redirect missing translations to default
59 location ~ ^/([a-z][a-z]\_[A-Z][A-Z])(/.+) {
60 if (!-e "$document_root$uri")
61 {
62 # if there is no /es_Mx/page, redirect to /es/page instead:
63 rewrite ^/([a-z][a-z])\_([A-Z][A-Z])(/.+) /$1$3 redirect;
64 }
65 }
66
67 location ~ ^/([a-z][a-z])(/.+) {
68 if (!-e "$document_root$uri")
69 {
70 # if there is no /es/page, redirect to /page instead:
71 rewrite ^/([a-z][a-z])(/.+) $2 redirect;
72 }
73 }
74
75 <% if @multiplexer_locations %> 58 <% if @multiplexer_locations %>
76 <% @multiplexer_locations.each do |location| %> 59 <% @multiplexer_locations.each do |location| %>
77 location <%= location %> 60 location <%= location %>
78 { 61 {
79 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; 62 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock;
80 include /etc/nginx/fastcgi_params; 63 include /etc/nginx/fastcgi_params;
81 } 64 }
82 <% end %> 65 <% end %>
83 <% end %> 66 <% end %>
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