-
Notifications
You must be signed in to change notification settings - Fork 1
[HOTFIX] - nginx 설정에서 HTTP/2 프로토콜로 변경 및 프록시 헤더 추가 (#170) #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안녕하세요. Nginx 설정 변경에 대한 리뷰입니다. HTTP/2로 변경하고 프록시 헤더를 추가하는 좋은 시도이지만, 몇 가지 잠재적인 문제가 있어 의견을 남깁니다.
HTTP/2 프록시 호환성:
proxy_http_version을2.0으로 설정하셨습니다. 하지만proxy_pass가http://를 사용하고 있고, 업스트림 Next.js 서버(client:3000)는 HTTP/2 Cleartext(h2c)를 지원하지 않을 가능성이 높습니다. 이 경우 프록시 연결이 실패하여 서비스가 중단될 수 있습니다. 업스트림 서버가 명시적으로 h2c를 지원하도록 설정되지 않았다면,proxy_http_version은1.1로 유지하는 것이 안전합니다.WebSocket 지원 누락: WebSocket 프록시에 필요한
Upgrade및Connection헤더 설정이 제거되었습니다. 만약 애플리케이션에서 WebSocket을 사용한다면 (예: 실시간 알림), 이 변경으로 인해 WebSocket 기능이 동작하지 않게 됩니다. Nginx와 백엔드 서버 간의 통신을 HTTP/1.1로 유지한다면, WebSocket을 지원하기 위해 이 헤더들을 다시 추가해야 합니다. 참고로,proxy_set_header Connection 'upgrade';대신map지시어를 사용하면 더 안정적으로 WebSocket 연결을 처리할 수 있습니다.중복 헤더:
proxy_set_header Host $host;가 이미 설정되어 있으므로proxy_set_header X-Forwarded-Host $host;는 중복입니다. 대부분의 프레임워크는Host헤더를 우선적으로 사용하므로X-Forwarded-Host는 제거해도 무방합니다.아래와 같이 수정하여 안정성을 확보하고 WebSocket 지원을 유지하는 것을 제안합니다.