Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
da4910db
Commit
da4910db
authored
Jul 24, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
235d9bcd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
nginx.conf
+13
-2
No files found.
nginx.conf
View file @
da4910db
...
...
@@ -5,15 +5,26 @@ server {
root
/usr/share/nginx/html
;
index
index.html
;
# 确保正确的 MIME 类型
include
/etc/nginx/mime.types
;
# 静态资源直接返回,不经过 try_files
location
~
*
\
.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)
$
{
expires
1y
;
# 静态资源缓存
add_header
Cache-Control
"public"
;
access_log
off
;
log_not_found
off
;
}
# 主应用路由(history 模式)
location
/
{
try_files
$uri
$uri
/
/index.html
;
add_header
Cache-Control
"no-store,
no-cache,
must-revalidate"
;
}
# 子应用 /cffp/ 路由
(关键修正)
# 子应用 /cffp/ 路由
location
/cffp/
{
try_files
$uri
$uri
/
/
index.html
;
# 改为指向根目录的 index.html
try_files
$uri
$uri
/
/
cffp/index.html
;
}
# 禁止访问 .env 文件
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment