We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f61d01 commit bcd1896Copy full SHA for bcd1896
1 file changed
deploy/docker/nginx.conf
@@ -5,13 +5,28 @@ server {
5
index index.html;
6
7
# 设置404错误页面
8
- error_page 404 /404.html;
+ error_page 404 @handle_404;
9
+
10
+ # 处理404页面的逻辑
11
+ location @handle_404 {
12
+ # 检查是否为英文版本(以/en/开头)
13
+ if ($uri ~ ^/en/) {
14
+ return 302 /en/404.html;
15
+ }
16
+ # 默认返回中文404页面
17
+ return 302 /404.html;
18
19
20
# 确保404.html能够正常访问
21
location = /404.html {
22
# 移除 internal 指令,允许直接访问404页面
23
try_files $uri =404;
24
}
25
26
+ # 确保英文版404.html能够正常访问
27
+ location = /en/404.html {
28
+ try_files $uri =404;
29
30
31
# 重定向规则
32
location = /use {
0 commit comments