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

Side by Side Diff: modules/web/templates/site.conf.erb

Issue 29537689: #3299 - Add URI redirect for missing translations (Closed) Base URL: https://hg1/infrastructure
Patch Set: Created Sept. 6, 2017, 10:54 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 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 rewrite ^(.*) /en$1 last; 47 rewrite ^(.*) /en$1 last;
48 } 48 }
49 49
50 # Redirect server/language root 50 # Redirect server/language root
51 51
52 rewrite ^/$ /$index_page last; 52 rewrite ^/$ /$index_page last;
53 rewrite ^/(\w\w(_\w\w)?)$ /$1/ permanent; 53 rewrite ^/(\w\w(_\w\w)?)$ /$1/ permanent;
54 rewrite ^/(\w\w(_\w\w)?)/$ /$1/$index_page last; 54 rewrite ^/(\w\w(_\w\w)?)/$ /$1/$index_page last;
55 } 55 }
56 56
57 # http://hub.eyeo.com/issues/3299 Redirect missing translations to default
58 location ~ ^/([a-z][a-z])(/.+) {
59 if (!-e "$document_root$uri")
60 {
61 rewrite ^/([a-z][a-z])(/.+) $2 redirect;
62 }
63 }
64
65 # http://hub.eyeo.com/issues/3299 Redirect missing translations to default
66 location ~ ^/([a-z][a-z]\_[A-Z][A-Z])(/.+) {
f.nicolaisen 2017/09/06 23:00:19 It would be cool if we could join both these locat
67 if (!-e "$document_root$uri")
68 {
69 rewrite ^/([a-z][a-z]\_[A-Z][A-Z])(/.+) $2 redirect;
f.nicolaisen 2017/09/06 23:00:19 Lots of duplication here :(
70 }
71 }
72
57 <% if @multiplexer_locations %> 73 <% if @multiplexer_locations %>
58 <% @multiplexer_locations.each do |location| %> 74 <% @multiplexer_locations.each do |location| %>
59 location <%= location %> 75 location <%= location %>
60 { 76 {
61 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; 77 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock;
62 include /etc/nginx/fastcgi_params; 78 include /etc/nginx/fastcgi_params;
63 } 79 }
64 <% end %> 80 <% end %>
65 <% end %> 81 <% end %>
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