Skip to content

Conversation

@eun-seoo
Copy link
Contributor

📌 작업한 내용

배포된 Swagger UI에서 API 요청 시 발생하던 403 CORS 오류를 해결하기 위해
스프링 WebConfig의 allowedOrigins 목록에 Swagger UI 도메인을 추가했습니다.

원인은 다음 두 가지로 확인되었습니다:

  1. 스프링 WebConfig의 allowedOrigins에 Swagger 도메인이 포함되지 않았습니다.
  2. Caddy reverse proxy가 OPTIONS 요청(CORS preflight)을 처리하지 못했습니다.

🔍 참고 사항

  • allowedOrigins에 다음 도메인을 추가했습니다.
    https://43-201-35-136.nip.io

  • Swagger는 API 요청 전 OPTIONS preflight 요청을 보냅니다. 하지만 기존 Caddy 설정은 OPTIONS 요청을 처리하지 못해 403이 발생했습니다. 이를 해결하기 위해 CORS 프리플라이트 핸들러를 추가했습니다.

🖼️ 스크린샷

🔗 관련 이슈

#24

✅ 체크리스트

  • 로컬에서 빌드 및 테스트 완료
  • 코드 리뷰 반영 완료
  • 문서화 필요 여부 확인

@eun-seoo eun-seoo linked an issue Nov 17, 2025 that may be closed by this pull request
@eun-seoo eun-seoo self-assigned this Nov 17, 2025
@eun-seoo eun-seoo merged commit e75f832 into develop Nov 17, 2025
1 check passed
@eun-seoo eun-seoo deleted the bugfix/#24-cors-bugfix branch November 19, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BugFix] Swagger UI에서 발생하는 CORS 403 오류 해결

2 participants