Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions nginx/nginx.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ http {

location / {
proxy_pass http://next-server/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_http_version 2.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

proxy_http_version2.0으로 설정하면 프록시 대상인 업스트림 서버(next-server)가 HTTP/2를 지원해야 합니다. 현재 client:3000으로 설정된 Next.js 애플리케이션은 기본적으로 HTTP/1.1만 지원하므로, 이 설정은 연결 오류를 유발할 수 있습니다. 업스트림 서버가 HTTP/2를 지원하는지 확인하고, 그렇지 않다면 1.1로 되돌리는 것이 안전합니다.

            proxy_http_version 1.1;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache_bypass $http_upgrade;
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;
}
Comment on lines 45 to 54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

WebSocket 지원에 필요한 UpgradeConnection 헤더 설정이 제거되었습니다. proxy_http_version2.0으로 변경하면서 함께 제거하신 것으로 보입니다. 하지만 이전 코멘트에서 언급했듯이 업스트림 서버가 HTTP/1.1만 지원할 가능성이 높습니다. 이 경우 proxy_http_version1.1로 되돌려야 하며, 만약 애플리케이션에서 WebSocket을 사용한다면 UpgradeConnection 헤더도 다시 추가해야 합니다. 애플리케이션의 WebSocket 사용 여부를 확인하고 필요 시 관련 설정을 복원해주세요.

}

Expand Down