fix: Simplify nginx config - let Next.js handle API rewrites

- Remove complex location blocks from nginx
- Let Next.js rewrites handle API routing to CMS
- Keep only basic proxy configuration

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-03-27 14:12:12 -03:00
parent 422a143685
commit e1f0d9ceb7
2 changed files with 3 additions and 213 deletions
-30
View File
@@ -3,33 +3,3 @@ map $http_x_forwarded_proto $origin_proto {
default $http_x_forwarded_proto;
"" $scheme;
}
# Map to detect API routes that should go to CMS (port 3001)
map $request_uri $cms_api {
default 0;
~^/auth/(register|me|profile|password|reset|verify|logout) 1;
~^/auth/login$ 2; # Special case - handled with if
~^/branding/?$ 1;
~^/courses/?$ 1;
~^/admin/?$ 1;
~^/organization/?$ 1;
~^/users/ 1;
~^/question-bank/ 1;
~^/test-templates/ 1;
~^/knowledge-base/ 1;
~^/api/ 1;
~^/assets/ 1;
~^/modules/ 1;
~^/lessons/ 1;
~^/grading/ 1;
~^/token-usage/ 1;
~^/sam/ 1;
~^/embeddings/ 1;
=/health 1;
}
# For /auth/login, only POST should go to CMS
map "$request_uri:$request_method" $login_post {
default 0;
"~^/auth/login$:POST" 1;
}