From 974938d8aa964d815ee7cd4025ea085e99698775 Mon Sep 17 00:00:00 2001 From: chpark Date: Thu, 14 May 2026 15:12:45 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20API=20=ED=98=B8=EC=B6=9C=20?= =?UTF-8?q?=EC=A0=88=EB=8C=80=20URL=20:8080=20=EC=A7=81=EA=B2=A9=20?= =?UTF-8?q?=E2=86=92=20=EC=83=81=EB=8C=80=20/api=20=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 브라우저가 백엔드 포트 8080 직접 접근 가능하다는 가정이 깨지면(방화벽/포트 제한) 로그인 실패. 모든 호출을 FE 자신의 /api 로 보내고 next.config rewrites() 가 SERVER_API_URL 로 프록시. 브라우저는 FE 포트(예: 9771) 한 곳만 열려 있으면 됨. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/lib/api/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/lib/api/client.ts b/frontend/lib/api/client.ts index 717c35b3..5d9aac4a 100644 --- a/frontend/lib/api/client.ts +++ b/frontend/lib/api/client.ts @@ -35,9 +35,9 @@ const getApiBaseUrl = (): string => { return "https://api.vexplor.com/api"; } - // 접속 host 기준 포트 8080 백엔드로 — 엣지 배포 일반화 경로 - const protocol = window.location.protocol; - return `${protocol}//${currentHost}:8080/api`; + // 엣지/온프레미스 일반화: FE 자신을 통한 상대 경로 사용 → next.config rewrites() 가 + // /api/* 를 SERVER_API_URL 로 프록시. 브라우저는 FE 포트(9771 등) 한 곳만 열려 있으면 됨. + return "/api"; } return "http://localhost:8080/api";