chore: nginx에 Swagger UI/OpenAPI 문서 프록시 경로 추가 - #245
Merged
Conversation
/api 프리픽스 밖에 있는 백엔드 springdoc 경로(/swagger-ui/**, /swagger-ui.html, /v3/api-docs)가 SPA fallback(index.html)으로 떨어져 배포 도메인에서 열리지 않던 문제를 backend로 직접 프록시하여 해결한다. Closes #244
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 내용
nginx.conf에/swagger-ui/,/swagger-ui.html(정확히 일치),/v3/api-docs(정확히 일치)를backend:8080으로 프록시하는 location 3개 추가/api/프록시, SPA fallback(location /)은 그대로 유지배경
백엔드에 springdoc-openapi 기반 Swagger 문서를 도입했지만(back-end#213, back-end#215), 기존
nginx.conf는/api/만 프록시하고 있어 배포 도메인에서 Swagger 경로 요청이 backend로 가지 않고 SPA fallback(index.html)으로 떨어져 열리지 않았다.검증
docker compose config통과docker compose up -d --build backend frontend로 로컬 재현 후frontend컨테이너 내부에서 직접 확인 (호스트 5173 포트는 로컬 vite dev 서버가 이미 점유하고 있어 컨테이너 내부 127.0.0.1:80으로 직접 검증)GET /v3/api-docs→ 200GET /swagger-ui/index.html→ 200, 본문이 실제 swagger-ui 정적 번들(SPA index.html이 아님) 확인GET /→ 200, 기존 SPA 라우팅 정상 유지 확인nginx -t문법 검증 통과연결 이슈
Closes #244