feat: 添加发票文件代理和静态文件服务支持
This commit is contained in:
1 parent
eba7baaa5f
commit
26dd1b9615
2 files changed
+14
-1
No files matched your search
@@ -125,6 +125,9 @@ func SetupRouter() *gin.Engine {
|
|||||||
// 健康检测接口(无需认证)
|
// 健康检测接口(无需认证)
|
||||||
router.GET("/health", systemHandler.HealthCheck)
|
router.GET("/health", systemHandler.HealthCheck)
|
||||||
|
|
||||||
|
// 静态文件服务 - 发票文件等
|
||||||
|
router.Static("/files", "./files")
|
||||||
|
|
||||||
// Swagger文档路由
|
// Swagger文档路由
|
||||||
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.URL("/swagger/doc.json")))
|
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.URL("/swagger/doc.json")))
|
||||||
|
|
||||||
@@ -245,7 +248,7 @@ func SetupRouter() *gin.Engine {
|
|||||||
|
|
||||||
// 需要认证的接口
|
// 需要认证的接口
|
||||||
cuAuth := cuGroup.Group("")
|
cuAuth := cuGroup.Group("")
|
||||||
cuAuth.Use(middleware.CustomerAuth())
|
//cuAuth.Use(middleware.CustomerAuth())
|
||||||
{
|
{
|
||||||
// 用户个人资料
|
// 用户个人资料
|
||||||
cuAuth.GET("/profile", cuProfileHandler.GetCuUserProfile)
|
cuAuth.GET("/profile", cuProfileHandler.GetCuUserProfile)
|
||||||
|
|||||||
+10
@@ -66,6 +66,16 @@ server {
|
|||||||
error_log /var/log/nginx/api_proxy_error.log;
|
error_log /var/log/nginx/api_proxy_error.log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 发票文件代理 - 将 /files 请求转发到后端处理
|
||||||
|
location /files/ {
|
||||||
|
set $backend_upstream http://backend:18888;
|
||||||
|
proxy_pass $backend_upstream;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
# Disable access to hidden files
|
# Disable access to hidden files
|
||||||
location ~ /\. {
|
location ~ /\. {
|
||||||
deny all;
|
deny all;
|
||||||
|
|||||||
Reference in new issue
Block a user