Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf-front
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
1
Merge Requests
1
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
yuzhenWang
yd-csf-front
Commits
cc04ed71
Commit
cc04ed71
authored
Dec 08, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
66315b69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
41 deletions
+0
-41
nginx.conf
+0
-41
No files found.
nginx.conf
View file @
cc04ed71
...
@@ -37,47 +37,6 @@ server {
...
@@ -37,47 +37,6 @@ server {
}
}
}
}
# 代理API请求到网关服务
location
/api/
{
# 代理到已备案域名的443端口
proxy_pass
https://center.supguard.cn/api
;
# 注意:这里不需要rewrite,因为center.supguard.cn的nginx会处理
# 关键:设置Host头为已备案域名
proxy_set_header
Host
center.supguard.cn
;
proxy_set_header
X-Real-IP
$remote_addr
;
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for
;
proxy_set_header
X-Forwarded-Proto
$scheme
;
proxy_set_header
Authorization
$http_authorization
;
# 超时设置
proxy_connect_timeout
30s
;
proxy_read_timeout
30s
;
proxy_send_timeout
30s
;
# 缓冲区设置
proxy_buffering
on
;
proxy_buffer_size
4k
;
proxy_buffers
8
4k
;
# CORS 头
add_header
'Access-Control-Allow-Origin'
'*'
always
;
add_header
'Access-Control-Allow-Methods'
'GET,
POST,
PUT,
DELETE,
OPTIONS'
always
;
add_header
'Access-Control-Allow-Headers'
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'
always
;
# 处理OPTIONS请求(CORS预检)
if
(
$request_method
=
'OPTIONS')
{
add_header
'Access-Control-Allow-Origin'
'*'
;
add_header
'Access-Control-Allow-Methods'
'GET,
POST,
PUT,
DELETE,
OPTIONS'
;
add_header
'Access-Control-Allow-Headers'
'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'
;
add_header
'Access-Control-Max-Age'
1728000
;
add_header
'Content-Length'
0
;
add_header
'Content-Type'
'text/plain
;
charset=UTF-8'
;
return
204
;
}
}
# 健康检查接口
# 健康检查接口
location
/health
{
location
/health
{
access_log
off
;
access_log
off
;
...
...
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