Skip to content

fix: swagger-config 프록시 누락으로 Swagger UI가 petstore로 폴백되는 문제 수정 - #247

Merged
sjungwon03 merged 1 commit into
devfrom
fix/246-swagger-config-proxy
Jul 24, 2026
Merged

fix: swagger-config 프록시 누락으로 Swagger UI가 petstore로 폴백되는 문제 수정#247
sjungwon03 merged 1 commit into
devfrom
fix/246-swagger-config-proxy

Conversation

@sjungwon03

Copy link
Copy Markdown
Member

변경 내용

  • nginx.conflocation = /v3/api-docs(정확히 일치)를 location /v3/api-docs(prefix)로 변경

배경

#245 배포 후 실제로 확인해보니 Swagger UI가 https://petstore.swagger.io/v2/swagger.json 데모 스펙으로 떴다. 원인은 swagger-ui JS가 페이지 로드시 실제 스펙 위치를 알아내려고 GET /v3/api-docs/swagger-config를 추가로 호출하는데, 기존 nginx location이 /v3/api-docs를 정확히 일치로만 매칭해서 이 하위 경로 요청이 SPA fallback(index.html)으로 떨어졌기 때문이다. swagger-ui는 이 요청이 JSON이 아니면 조용히 기본 데모 설정으로 폴백한다.

검증

  • nginx -t 문법 검증 통과
  • docker compose up -d --build backend frontendfrontend 컨테이너 내부(127.0.0.1:80)에서 직접 확인
    • GET /v3/api-docs → 200
    • GET /v3/api-docs/swagger-config → 200, 응답 본문 "url":"/v3/api-docs" 확인 (이전에는 SPA index.html이 떨어졌음)
    • GET /swagger-ui/index.html → 200
    • GET / → 200, SPA 라우팅 정상 유지

연결 이슈

Closes #246

/v3/api-docs를 정확히 일치(location =)로 매칭해 swagger-ui가 실제
스펙 위치를 알아내려고 요청하는 /v3/api-docs/swagger-config 가
SPA fallback(index.html)으로 떨어졌다. prefix 매칭으로 바꿔
하위 경로도 backend로 프록시되게 한다.

Closes #246
@sjungwon03 sjungwon03 added the fix 오류 수정 label Jul 24, 2026
@sjungwon03 sjungwon03 self-assigned this Jul 24, 2026
@kilo-code-bot

kilo-code-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • nginx.conf

Reviewed by step-3.7-flash · Input: 42K · Output: 6.9K · Cached: 267.3K

@sjungwon03
sjungwon03 requested a review from imi21123 July 24, 2026 08:01
@sjungwon03
sjungwon03 merged commit 269e013 into dev Jul 24, 2026
2 checks passed
@sjungwon03
sjungwon03 deleted the fix/246-swagger-config-proxy branch July 24, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 오류 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Swagger UI가 petstore 데모 스펙으로 폴백되는 nginx 프록시 누락 수정

1 participant