# ───────────────────────────────────────────── # Nginx 설정 — 기존 Steve + FastAPI 통합 # # 기존 s1.byunc.com Nginx 설정에 아래 블록 추가. # Steve와 FastAPI를 같은 도메인에서 path로 분기. # ───────────────────────────────────────────── # ── upstream 정의 ── upstream fastapi_backend { server 127.0.0.1:8000; } # server 블록 내부에 아래 location 추가: # ── FastAPI API ── location /api/ { proxy_pass http://fastapi_backend; 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 60s; } # ── FastAPI Docs (Swagger UI) ── location /docs { proxy_pass http://fastapi_backend; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; } location /redoc { proxy_pass http://fastapi_backend; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; } location /openapi.json { proxy_pass http://fastapi_backend; } # ── 헬스체크 ── location /health { proxy_pass http://fastapi_backend; } # ── 관리자 대시보드 ── location = /dashboard { alias /home/byun/ev-charging-backend/dashboard.html; default_type text/html; } # ── 충전 페이지 (QR 스캔 진입점) ── # 프론트 배포 후 정적 파일 서빙 또는 SPA로 교체 location /charge/ { proxy_pass http://fastapi_backend; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; } # ── 기존 Steve 설정 (유지) ── # location /steve/ { ... } # location /steve/websocket/ { ... }