fix(frontend): API 호출 절대 URL :8080 직격 → 상대 /api 로 변경
Build and Push Images / build-and-push (push) Has been cancelled
Build and Push Images / build-and-push (push) Has been cancelled
브라우저가 백엔드 포트 8080 직접 접근 가능하다는 가정이 깨지면(방화벽/포트 제한) 로그인 실패. 모든 호출을 FE 자신의 /api 로 보내고 next.config rewrites() 가 SERVER_API_URL 로 프록시. 브라우저는 FE 포트(예: 9771) 한 곳만 열려 있으면 됨. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,9 +35,9 @@ const getApiBaseUrl = (): string => {
|
|||||||
return "https://api.vexplor.com/api";
|
return "https://api.vexplor.com/api";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 접속 host 기준 포트 8080 백엔드로 — 엣지 배포 일반화 경로
|
// 엣지/온프레미스 일반화: FE 자신을 통한 상대 경로 사용 → next.config rewrites() 가
|
||||||
const protocol = window.location.protocol;
|
// /api/* 를 SERVER_API_URL 로 프록시. 브라우저는 FE 포트(9771 등) 한 곳만 열려 있으면 됨.
|
||||||
return `${protocol}//${currentHost}:8080/api`;
|
return "/api";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "http://localhost:8080/api";
|
return "http://localhost:8080/api";
|
||||||
|
|||||||
Reference in New Issue
Block a user