fix: CORS 修复 - 允许 223.109.142.84:8000 直连请求 + nginx sub_filter
- .env.prod: API_CORS_ORIGINS 增加 http://223.109.142.84:8000 (前端 JS 中硬编码了 NEXT_PUBLIC_API_BASE_URL=http://223.109.142.84:8000, 请求直接打到容器的 8000 端口绕过 nginx,需在 CORS 层放行) - 84 nginx: /_next/static/ location 增加 sub_filter 规则将 http://223.109.142.84:8000 重写为 https://www.quizck.cn(长期方案)
This commit is contained in:
@@ -55,5 +55,5 @@ POSTGRES_PASSWORD=replace_strong_password
|
||||
|
||||
NEXT_PUBLIC_APP_BASE_PATH=/fl
|
||||
|
||||
API_CORS_ORIGINS=https://www.quizck.cn,https://quizck.cn,http://localhost:3000,http://127.0.0.1:3000
|
||||
API_CORS_ORIGINS=https://www.quizck.cn,https://quizck.cn,http://223.109.142.84:8000,http://localhost:3000,http://127.0.0.1:3000
|
||||
API_CORS_ORIGIN_REGEX=
|
||||
|
||||
Reference in New Issue
Block a user