Skip to content

Commit dec99ae

Browse files
committed
修复重定向问题
1 parent bcd1896 commit dec99ae

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

deploy/docker/nginx.conf

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,14 @@ server {
2828
try_files $uri =404;
2929
}
3030

31-
# 重定向规则
32-
location = /use {
33-
return 301 /docs/use/;
34-
}
35-
36-
location = /use/ {
37-
return 301 /docs/use/;
38-
}
39-
40-
location = /docs/use/ {
41-
return 301 /docs/use/use/;
42-
}
43-
44-
location ~ ^/dev/(.*)$ {
45-
return 301 /docs/dev/$1;
46-
}
47-
48-
location = /dev {
49-
return 301 /docs/dev/;
50-
}
51-
52-
location ~ ^/change/(.*)$ {
53-
return 301 /docs/change/$1;
54-
}
55-
56-
location = /change {
57-
return 301 /docs/change/;
58-
}
59-
6031
# 尝试文件,如果不存在则显示404页面
6132
location / {
62-
try_files $uri $uri/ /404.html;
33+
try_files $uri $uri/index.html $uri/ /404.html;
6334
}
6435

6536
# 缓存静态资源
6637
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
67-
expires 1y;
38+
expires 1d;
6839
add_header Cache-Control "public, immutable";
6940
}
7041
}

0 commit comments

Comments
 (0)