Merged
Conversation
[RELEASE-20250821]
[REALEASE-20250826] 배포
[RELEASE-20250905]
[RELEASE-20250921]
[HOTFIX] - nginx 설정에서 HTTP/2 프로토콜로 변경 및 프록시 헤더 추가 (#170)
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
There was a problem hiding this comment.
Code Review
이 PR은 nginx.prod.conf 설정을 변경하여 WebSocket을 지원하도록 수정하고 HTTP/2를 비활성화하는 핫픽스를 적용하는 것으로 보입니다. 이러한 변경은 의도된 것으로 이해됩니다. 하지만 이 과정에서 백엔드 애플리케이션에 중요한 X-Forwarded-For와 X-Forwarded-Proto 헤더가 제거된 것으로 보입니다. 이 헤더들은 클라이언트의 실제 IP 주소와 프로토콜을 백엔드로 전달하는 데 필수적이므로, 다시 추가하는 것을 강력히 권장합니다. 이 문제를 해결하기 위한 구체적인 코드 제안을 포함한 리뷰 의견을 남겼습니다.
Comment on lines
+47
to
+52
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection 'upgrade'; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| proxy_set_header X-Forwarded-Host $host; | ||
| proxy_set_header X-Forwarded-Port $server_port; | ||
| proxy_cache_bypass $http_upgrade; |
Contributor
There was a problem hiding this comment.
WebSocket 지원을 위한 헤더를 추가하면서 X-Forwarded-For 및 X-Forwarded-Proto 헤더가 제거되었습니다. 이 헤더들은 백엔드 애플리케이션(Next.js)이 클라이언트의 실제 IP 주소와 원래 요청 프로토콜(HTTPS)을 파악하는 데 매우 중요합니다.
X-Forwarded-For: 이 헤더가 없으면 백엔드에서 클라이언트 IP를 알 수 없어 로깅, 보안(예: IP 기반 접근 제어) 등에서 문제가 발생할 수 있습니다. 특히,nginx.conf파일의 42번째 줄에real_ip_header X-Forwarded-For;가 설정되어 있고, 56번째 줄의 로그 포맷에서도$http_x_forwarded_for를 사용하고 있어 이 헤더는 필수적입니다.X-Forwarded-Proto: 이 헤더는 백엔드가 리디렉션이나 URL 생성 시 올바른 프로토콜(https)을 사용하도록 보장합니다.
아래와 같이 해당 헤더들을 다시 추가하는 것을 권장합니다.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
🛠️ Build SummaryStatus: ✅ SUCCESS 📋 Build Output (마지막 45줄)🤖 Generated by GitHub Actions at Mon Sep 22 03:48:30 UTC 2025 |
🚀 Lighthouse Report for TEST1📅 Date: 9/22/2025
📊 Performance Details
🚀 Lighthouse Report for TEST2📅 Date: 9/22/2025
📊 Performance Details
🚀 Lighthouse Report for TEST3📅 Date: 9/22/2025
📊 Performance Details
🚀 Lighthouse Report for TEST4📅 Date: 9/22/2025
📊 Performance Details
🚀 Lighthouse Report for TEST5📅 Date: 9/22/2025
📊 Performance Details
|
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.
prod 브랜치에서 분기하여 추가된 hotfix 반영사항을 dev branch에서도 반영하기 위한 pr입니다.