Files
tk-factory-services/gateway/nginx.conf
Hyungi Ahn baf68ca065 feat(gateway): 통합 대시보드 네비게이션 허브 추가
로그인 후 다른 시스템으로의 진입점이 없던 문제 해결.
dashboard.html에 로그인 폼 + 네비게이션 허브를 통합하고,
/, /login을 /dashboard로 리다이렉트.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:51:05 +09:00

99 lines
3.1 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
client_max_body_size 50M;
# ===== Gateway 자체 페이지 (포털, 로그인) =====
root /usr/share/nginx/html;
# 대시보드 (로그인 + 네비게이션 허브 통합)
location = /dashboard {
add_header Cache-Control "no-store, no-cache, must-revalidate";
add_header Pragma "no-cache";
try_files /dashboard.html =404;
}
# 루트 → 대시보드 리다이렉트
location = / {
return 302 /dashboard$is_args$args;
}
# 로그인 → 대시보드 리다이렉트
location = /login {
return 302 /dashboard$is_args$args;
}
# 공유 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 (맥미니 home-service-proxy 경유) =====
location /ai-api/ {
resolver 8.8.8.8 valid=300s ipv6=off;
set $ai_upstream https://ai.hyungi.net;
rewrite ^/ai-api/(.*) /api/ai/$1 break;
proxy_pass $ai_upstream;
proxy_http_version 1.1;
proxy_set_header Host ai.hyungi.net;
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_ssl_server_name on;
proxy_read_timeout 180s;
proxy_send_timeout 180s;
}
# ===== 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;
}
}