Files
tk-factory-services/gateway/nginx.conf
Hyungi Ahn 5aeda43605 fix: 전 시스템 Chrome 무한 로그인 루프 해결 및 role 대소문자 통일
- gateway: 로그인 페이지 자동 리다이렉트 시 SSO 쿠키 재설정 + Cache-Control no-store
- tkreport(system2): SW 해제, 401 핸들러 리다이렉트 제거, 루프 방지, localStorage 백업
- TKQC 모바일(system3): mCheckAuth를 authManager 위임으로 변경, 루프 방지
- TKQC 공통(system3): api.js 로그인 URL 캐시 버스팅, auth-manager localStorage 백업
- tkuser: SW 해제, 401 핸들러 수정, 루프 방지, localStorage 백업, requireAdmin role 소문자 통일
- system1: 작업보고서 admin role 대소문자 무시, refresh 토큰에 role 필드 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 14:10:46 +09:00

85 lines
2.7 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
client_max_body_size 50M;
# ===== Gateway 자체 페이지 (포털, 로그인) =====
root /usr/share/nginx/html;
# 로그인 페이지 (캐시 금지 — SSO 쿠키 재설정 로직 항상 최신 반영)
location = /login {
add_header Cache-Control "no-store, no-cache, must-revalidate";
add_header Pragma "no-cache";
try_files /login.html =404;
}
# 공유 JS/CSS (nav-header 등)
location /shared/ {
alias /usr/share/nginx/html/shared/;
}
# ===== SSO Auth API =====
location /auth/ {
proxy_pass http://sso-auth:3000/api/auth/;
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;
}
# ===== System 1 API 프록시 =====
location /api/ {
proxy_pass http://system1-api:3005/api/;
proxy_http_version 1.1;
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;
}
# ===== System 1 업로드 파일 =====
location /uploads/ {
proxy_pass http://system1-api:3005/uploads/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# ===== System 1 FastAPI Bridge =====
location /fastapi/ {
proxy_pass http://system1-fastapi:8000/;
proxy_http_version 1.1;
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;
}
# ===== AI Service API =====
location /ai-api/ {
proxy_pass http://ai-service:8000/api/ai/;
proxy_http_version 1.1;
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;
proxy_read_timeout 120s;
proxy_send_timeout 120s;
}
# ===== System 1 Web (나머지 모든 경로) =====
location / {
proxy_pass http://system1-web:80;
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;
}
# ===== Health Check =====
location /health {
return 200 '{"status":"ok","service":"gateway"}';
add_header Content-Type application/json;
}
}