Skip to content

Commit a068118

Browse files
committed
Add NGINX redirect rules for erroneous API pages and test configuration
Introduced new redirect rules in NGINX snippets to address erroneous API pages and added a localized test configuration for debugging.
1 parent 304eac9 commit a068118

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

etc/nginx/snippets/nginx.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Used with a docker container for localised testing.
2+
3+
events {
4+
worker_connections 1024;
5+
}
6+
7+
http {
8+
server {
9+
listen 80;
10+
server_name localhost;
11+
12+
# Your optimized redirect rules
13+
location ~* ^/mobile/([^/]+)/([^/]+)/Enumerations\.html$ {
14+
return 301 /mobile/$1/$2/Enums.html;
15+
}
16+
17+
location ~* ^/mobile/([^/]+)/([^/]+)/Structures\.html$ {
18+
return 301 /mobile/$1/$2/Structs.html;
19+
}
20+
21+
# Add a test page
22+
location / {
23+
default_type text/plain;
24+
return 200 "Test page\n";
25+
}
26+
}
27+
}

etc/nginx/snippets/rewrites.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,14 @@ location ^~ /admin/admin/ {
242242
# final redirect to archives
243243
rewrite ^/admin/(.*)$ $scheme://docs-archive.couchbase.com/docs-3x/$1 permanent;
244244
}
245+
246+
# Send some of the erroneous API pages to their correct pages
247+
248+
location ~* ^/mobile/([^/]+)/([^/]+)/Enumerations\.html$ {
249+
return 301 /mobile/$1/$2/Enums.html;
250+
}
251+
252+
location ~* ^/mobile/([^/]+)/([^/]+)/Structures\.html$ {
253+
return 301 /mobile/$1/$2/Structs.html;
254+
}
255+

0 commit comments

Comments
 (0)