Skip to content

Commit 0a34b07

Browse files
committed
nodejs.org: falling back to english when page hasn't been translated.
Refs nodejs/nodejs.org#490
1 parent 4030c77 commit 0a34b07

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setup/www/resources/config/nodejs.org

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ server {
4545
}
4646

4747
location / {
48+
try_files $uri $uri/ @english_fallback;
49+
4850
location ~ \.json$ {
4951
add_header access-control-allow-origin *;
5052
}
@@ -59,6 +61,13 @@ server {
5961
add_header access-control-allow-origin *;
6062
}
6163
}
64+
65+
66+
# instead of serving a 404 page when a page hasn't been translated
67+
location @english_fallback {
68+
rewrite ^/(it|ko)/(.*)$ http://nodejs.org/en/$2;
69+
return 404;
70+
}
6271
}
6372

6473
server {

0 commit comments

Comments
 (0)