From 323d7761fa29cc51fde16d64bfd4db6effaa044e Mon Sep 17 00:00:00 2001 From: TING <1127163160@qq.com> Date: Tue, 20 Aug 2024 21:24:33 +0800 Subject: [PATCH] :tada: version(architecture): v0.3 --- .github/workflows/nginx.conf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nginx.conf b/.github/workflows/nginx.conf index 87e4edf..3cca9e1 100644 --- a/.github/workflows/nginx.conf +++ b/.github/workflows/nginx.conf @@ -89,7 +89,7 @@ http { server_name 139.199.173.241; # location /docs 则最后不加/ # location /docs/ 则最后加/ - location /docs { + location / { if ($request_filename ~* .*\.(?:htm|html)$) ## 配置页面不缓存html和htm结尾的文件 { add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; @@ -101,6 +101,18 @@ http { # 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html try_files $uri $uri/ /index.html; } + location /docs { + if ($request_filename ~* .*\.(?:htm|html)$) ## 配置页面不缓存html和htm结尾的文件 + { + add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; + } + # 把匹配到的路径重写, 注意要以/结尾 + alias /usr/share/nginx/html/docs; + # 默认首页 + index index.html; + # 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html + try_files $uri $uri/ /index.html; + } } }