| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 # Redirect language URIs if no translations are found for the requested page | |
| 59 | |
| 60 location ~ ^/([a-z][a-z]\_[A-Z][A-Z])(/.+) { | |
|
mathias
2017/09/08 19:20:20
There's a newline missing in front of the bracket.
f.nicolaisen
2017/09/11 07:33:14
Acknowledged.
| |
| 61 if (!-e "$document_root$uri") | |
| 62 { | |
| 63 # if there is no language+region translation, try parent language URI | |
| 64 # example /es_MX/page -> /es/page | |
| 65 rewrite ^/([a-z][a-z])\_([A-Z][A-Z])(/.+) /$1$3 redirect; | |
|
mathias
2017/09/08 19:20:20
This seems a bit quirky, it would move the user fr
f.nicolaisen
2017/09/11 07:33:14
Yes, this is quirky - if someone has manually chos
| |
| 66 } | |
| 67 } | |
| 68 | |
|
mathias
2017/09/08 19:20:20
There's a newline missing in front of the bracket.
f.nicolaisen
2017/09/11 07:33:14
Acknowledged.
| |
| 69 location ~ ^/([a-z][a-z])(/.+) { | |
| 70 if (!-e "$document_root$uri") | |
| 71 { | |
| 72 # if there is no language translation, try canonical page for default langua ge | |
| 73 # example /es/page -> /page | |
| 74 rewrite ^/([a-z][a-z])(/.+) $2 redirect; | |
| 75 } | |
| 76 } | |
| 77 | |
| 58 <% if @multiplexer_locations %> | 78 <% if @multiplexer_locations %> |
| 59 <% @multiplexer_locations.each do |location| %> | 79 <% @multiplexer_locations.each do |location| %> |
| 60 location <%= location %> | 80 location <%= location %> |
| 61 { | 81 { |
| 62 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; | 82 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; |
| 63 include /etc/nginx/fastcgi_params; | 83 include /etc/nginx/fastcgi_params; |
| 64 } | 84 } |
| 65 <% end %> | 85 <% end %> |
| 66 <% end %> | 86 <% end %> |
| OLD | NEW |