Skip to content

Commit

Permalink
nodejs.org: falling back to english when page hasn't been translated.
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipj committed Mar 9, 2016
1 parent 4030c77 commit 224dcdb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions setup/www/resources/config/nodejs.org
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ server {
}

location / {
try_files $uri $uri/ @english_fallback;

location ~ \.json$ {
add_header access-control-allow-origin *;
}
Expand All @@ -59,6 +61,12 @@ server {
add_header access-control-allow-origin *;
}
}

# instead of serving a 404 page when a page hasn't been translated
location @english_fallback {
rewrite ^/(it|ko)/(.*)$ http://nodejs.org/en/$2;
return 404;
}
}

server {
Expand Down Expand Up @@ -215,11 +223,19 @@ server {
location / {
rewrite ^/$ /en/ redirect;

try_files $uri $uri/ @english_fallback;

location ~ \.json$ {
add_header access-control-allow-origin *;
}
}

# instead of serving a 404 page when a page hasn't been translated
location @english_fallback {
rewrite ^/(it|ko)/(.*)$ https://nodejs.org/en/$2;
return 404;
}

location /download {
alias /home/dist/nodejs;
autoindex on;
Expand Down

0 comments on commit 224dcdb

Please sign in to comment.