Skip to content

fix: HTTPS 전환 대비 forward-headers-strategy 설정 - #69

Closed
Junkov0 wants to merge 1 commit into
mainfrom
fix/https-forward-headers
Closed

fix: HTTPS 전환 대비 forward-headers-strategy 설정#69
Junkov0 wants to merge 1 commit into
mainfrom
fix/https-forward-headers

Conversation

@Junkov0

@Junkov0 Junkov0 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

작업 내용

nginx-lb(신규 분산환경) 뒤에서 HTTPS로 들어오는 요청을 애플리케이션이 올바르게 인식하도록 설정합니다.

변경 사항

  • server.forward-headers-strategy: framework 추가
  • nginx가 이미 X-Forwarded-Proto/X-Forwarded-For/Host 헤더를 넘겨주고 있었지만, 이 설정이 없어 Spring이 이를 신뢰하지 않고 항상 http로 인식하던 문제 수정
  • 미적용 시 OAuth2 리다이렉트 URI 생성, secure 쿠키 판단 등이 실제 스킴(https)과 어긋날 수 있음

체크리스트

  • 테스트 코드 작성 완료
  • 리뷰어 지정 완료

참고 사항

  • 운영 서버(momogo-app, momogo-app-2)에는 systemd 환경변수(SERVER_FORWARD_HEADERS_STRATEGY=framework)로 이미 동일하게 즉시 적용/재시작 완료함. 이 PR은 다음 정식 배포 시에도 유지되도록 소스에 반영하는 목적.
  • momogo-api:compileJava 통과 확인

관련 이슈

  • 없음

Summary by CodeRabbit

  • 버그 수정
    • 로드 밸런서를 통한 HTTPS 요청이 원본 보안 연결로 올바르게 처리되도록 개선했습니다.
    • 전달된 헤더를 기반으로 리디렉션 및 요청 URL이 정확하게 인식됩니다.

Set server.forward-headers-strategy=framework so requests proxied through
the nginx LB over HTTPS are recognized as secure by the app (correct OAuth2
redirect URIs, secure-cookie detection), instead of always looking like
plain HTTP.
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: acdccada-4dda-4f2b-97ae-d90f3f10c7e6

📥 Commits

Reviewing files that changed from the base of the PR and between 73758fe and e5f5dee.

📒 Files selected for processing (1)
  • momogo-api/src/main/resources/application.yaml

📝 Walkthrough

Walkthrough

Spring 서버에 forward-headers-strategy: framework 설정을 추가했다. 로드 밸런서가 전달한 원본 HTTPS 헤더를 Spring이 처리하도록 구성했다.

Changes

서버 헤더 설정

Layer / File(s) Summary
전달 헤더 처리 전략 설정
momogo-api/src/main/resources/application.yaml
Spring 서버가 전달된 헤더를 프레임워크 방식으로 처리하도록 forward-headers-strategy를 설정했다.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: jaejo, sunghuii

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 HTTPS 프록시 요청 처리를 위한 forward-headers-strategy 설정 변경을 정확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/https-forward-headers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant