File tree Expand file tree Collapse file tree 11 files changed +70
-6
lines changed
Expand file tree Collapse file tree 11 files changed +70
-6
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ location ~ ^/((2|3)(\.[0-9]+)?|dev)/\w+/[\d\w\.]+(?!\.html)$ {
182182 if (-f "${request_filename}.html") {
183183 return 301 https://$host:$request_uri.html;
184184 }
185+ error_page 404 /$1/404.html;
185186 add_header Surrogate-Key en/$1 always;
186187}
187188
Original file line number Diff line number Diff line change 1+ 3.14 404
Original file line number Diff line number Diff line change 1+ 3 404
Original file line number Diff line number Diff line change 1+ dev 404
Original file line number Diff line number Diff line change 1+ fr/3.14 404
Original file line number Diff line number Diff line change 1+ pl/3 404
Original file line number Diff line number Diff line change 1+ zh-cn/dev 404
Original file line number Diff line number Diff line change 11server {
22 listen 10000 ;
3+ root /srv/docroot;
4+ autoindex on;
35 include docs-redirects.conf;
46}
Original file line number Diff line number Diff line change 1+ GET {{host}}/3.14/not-a-file
2+ HTTP 404
3+ [Asserts]
4+ body contains "3.14 404"
5+
6+ GET {{host}}/3/not-a-file.html
7+ HTTP 404
8+ [Asserts]
9+ body contains "3 404"
10+
11+ GET {{host}}/3.14/whatsnew/3.1t4
12+ HTTP 404
13+ [Asserts]
14+ body contains "3.14 404"
15+
16+ GET {{host}}/3.14/library/not-a-file
17+ HTTP 404
18+ [Asserts]
19+ body contains "3.14 404"
20+
21+ GET {{host}}/3.14/library/notafile.html
22+ HTTP 404
23+ [Asserts]
24+ body contains "3.14 404"
25+
26+ GET {{host}}/3/whatsnew/not-a-file
27+ HTTP 404
28+ [Asserts]
29+ body contains "3 404"
30+
31+ GET {{host}}/fr/3.14/not-a-file
32+ HTTP 404
33+ [Asserts]
34+ body contains "fr/3.14 404"
35+
36+ GET {{host}}/fr/3.14/not-a-dir/not-a-file
37+ HTTP 404
38+ [Asserts]
39+ body contains "fr/3.14 404"
40+
41+ GET {{host}}/pl/3/not-a-dir/not-a-file.html
42+ HTTP 404
43+ [Asserts]
44+ body contains "pl/3 404"
45+
46+ GET {{host}}/pl/3/not-a-dir/not-a-dir/not-a-file.html
47+ HTTP 404
48+ [Asserts]
49+ body contains "pl/3 404"
50+
51+ GET {{host}}/pl/3/library/notafile.html
52+ HTTP 404
53+ [Asserts]
54+ body contains "pl/3 404"
Original file line number Diff line number Diff line change 33## Basic cases
44
55GET {{host}}/3/
6- HTTP 404
6+ HTTP 200
77[Asserts]
88header "Surrogate-Key" == "en/3"
99
@@ -30,7 +30,7 @@ HTTP 404
3030header "Surrogate-Key" == "en/2"
3131
3232GET {{host}}/dev/
33- HTTP 404
33+ HTTP 200
3434[Asserts]
3535header "Surrogate-Key" == "en/dev"
3636
@@ -284,7 +284,7 @@ HTTP 404
284284header "Surrogate-Key" == "en/3.13"
285285
286286GET {{host}}/3.14/
287- HTTP 404
287+ HTTP 200
288288[Asserts]
289289header "Surrogate-Key" == "en/3.14"
290290
@@ -396,7 +396,7 @@ HTTP 404
396396header "Surrogate-Key" == "fr/3"
397397
398398GET {{host}}/fr/3.14/
399- HTTP 404
399+ HTTP 200
400400[Asserts]
401401header "Surrogate-Key" == "fr/3.14"
402402
@@ -536,7 +536,7 @@ HTTP 404
536536header "Surrogate-Key" == "ko/dev"
537537
538538GET {{host}}/pl/3/
539- HTTP 404
539+ HTTP 200
540540[Asserts]
541541header "Surrogate-Key" == "pl/3"
542542
@@ -736,7 +736,7 @@ HTTP 404
736736header "Surrogate-Key" == "zh-cn/3.14"
737737
738738GET {{host}}/zh-cn/dev/
739- HTTP 404
739+ HTTP 200
740740[Asserts]
741741header "Surrogate-Key" == "zh-cn/dev"
742742
You can’t perform that action at this time.
0 commit comments