diff --git a/userfront/nginx.conf b/userfront/nginx.conf index e57c9eb5..a84a609c 100644 --- a/userfront/nginx.conf +++ b/userfront/nginx.conf @@ -26,10 +26,39 @@ server { error_log /dev/stderr warn; access_log /var/log/nginx/access.log json_combined; - # --- UserFront 정적 파일 --- + # --- Backend API Proxy --- + location /api { + proxy_pass http://baron_backend:3000; + 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; + } + + # --- Ory Stack Proxy (via Oathkeeper) --- + # Kratos Public API + location /auth { + proxy_pass http://oathkeeper:4455; + 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; + } + + # Hydra Public API (Rewrite /oidc/... to /...) + location /oidc { + rewrite ^/oidc/(.*)$ /$1 break; + proxy_pass http://oathkeeper:4455; + 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; + } + + # --- UserFront Static Files --- location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } -} +} \ No newline at end of file