server { listen 80; server_name _; client_max_body_size 50M; # ===== 포털/SSO 페이지 ===== root /usr/share/nginx/html; location = / { try_files /portal.html =404; } location = /login { try_files /login.html =404; } # 공유 JS/CSS 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: 공장관리 ===== location /factory/ { 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; } location /factory/api/ { proxy_pass http://system1-api:3005/api/; 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; } location /factory/fastapi/ { proxy_pass http://system1-fastapi:8000/; 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 2: 신고 ===== location /report/ { proxy_pass http://system2-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; } location /report/api/ { proxy_pass http://system2-api:3005/api/; 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 3: 부적합관리 ===== location /nc/ { proxy_pass http://system3-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; } location /nc/api/ { proxy_pass http://system3-api:8000/api/; 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; } }