From f6e05596f22e7cddd7385f1294ee8eacbabdb213 Mon Sep 17 00:00:00 2001 From: kyy Date: Fri, 30 Jan 2026 16:05:51 +0900 Subject: [PATCH] =?UTF-8?q?Hydra=20Public=20API=20(/oidc)=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20Rewrite=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userfront/nginx.conf | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) 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