diff --git a/setup/www/resources/config/nodejs.org b/setup/www/resources/config/nodejs.org index df6c738c7..190d111a8 100644 --- a/setup/www/resources/config/nodejs.org +++ b/setup/www/resources/config/nodejs.org @@ -45,6 +45,8 @@ server { } location / { + try_files $uri $uri/ @english_fallback; + location ~ \.json$ { add_header access-control-allow-origin *; } @@ -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 { @@ -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;