| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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]\_[A-Z][A-Z])(/.+) { |
| 59 if (!-e "$document_root$uri") |
| 60 { |
| 61 # if there is no /es_Mx/page, redirect to /es/page instead: |
| 62 rewrite ^/([a-z][a-z])\_([A-Z][A-Z])(/.+) /$1$3 redirect; |
| 63 } |
| 64 } |
| 65 |
| 66 location ~ ^/([a-z][a-z])(/.+) { |
| 67 if (!-e "$document_root$uri") |
| 68 { |
| 69 # if there is no /es/page, redirect to /page instead: |
| 70 rewrite ^/([a-z][a-z])(/.+) $2 redirect; |
| 71 } |
| 72 } |
| 73 |
| 57 <% if @multiplexer_locations %> | 74 <% if @multiplexer_locations %> |
| 58 <% @multiplexer_locations.each do |location| %> | 75 <% @multiplexer_locations.each do |location| %> |
| 59 location <%= location %> | 76 location <%= location %> |
| 60 { | 77 { |
| 61 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; | 78 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; |
| 62 include /etc/nginx/fastcgi_params; | 79 include /etc/nginx/fastcgi_params; |
| 63 } | 80 } |
| 64 <% end %> | 81 <% end %> |
| 65 <% end %> | 82 <% end %> |
| OLD | NEW |