File tree Expand file tree Collapse file tree
setup/www/resources/config Expand file tree Collapse file tree Original file line number Diff line number Diff 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,12 @@ server {
5961 add_header access-control-allow-origin *;
6062 }
6163 }
64+
65+ # instead of serving a 404 page when a page hasn't been translated
66+ location @english_fallback {
67+ rewrite ^/(it|ko)/(.*)$ http://nodejs.org/en/$2;
68+ return 404;
69+ }
6270}
6371
6472server {
@@ -215,11 +223,19 @@ server {
215223 location / {
216224 rewrite ^/$ /en/ redirect;
217225
226+ try_files $uri $uri/ @english_fallback;
227+
218228 location ~ \.json$ {
219229 add_header access-control-allow-origin *;
220230 }
221231 }
222232
233+ # instead of serving a 404 page when a page hasn't been translated
234+ location @english_fallback {
235+ rewrite ^/(it|ko)/(.*)$ https://nodejs.org/en/$2;
236+ return 404;
237+ }
238+
223239 location /download {
224240 alias /home/dist/nodejs;
225241 autoindex on;
You can’t perform that action at this time.
0 commit comments