Browse Source

Update:更新readme

XieXing 3 months ago
parent
commit
0d5fdfa7e5
2 changed files with 12 additions and 0 deletions
  1. 11 0
      nginx-prod.conf
  2. 1 0
      shudao-go-backend/utils/auth_middleware.go

+ 11 - 0
nginx-prod.conf

@@ -105,6 +105,17 @@ server {
         proxy_set_header X-Forwarded-Proto $scheme;
     }
 
+    # 推荐问题接口(无需JWT,首页加载时调用)
+    location /apiv1/recommend_question {
+        limit_req zone=limit_ip_uri burst=20 nodelay;
+        limit_conn conn_by_ip 20;
+        proxy_pass http://127.0.0.1:22001;
+        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;
+    }
+
     # 系统后端API(需JWT鉴权)
     location /apiv1 {
         limit_req zone=limit_ip_uri burst=20 nodelay;

+ 1 - 0
shudao-go-backend/utils/auth_middleware.go

@@ -17,6 +17,7 @@ var skipPaths = []string{
 	"/src/",
 	"/apiv1/oss/parse",
 	"/apiv1/auth/local_login",
+	"/apiv1/recommend_question",
 }
 
 // AuthMiddleware Token认证中间件