Complete the code to enable WebSocket proxying by setting the upgrade header.
proxy_set_header Upgrade [1];The Upgrade header must be set to "upgrade" (case-sensitive) to enable WebSocket proxying in nginx.
Complete the code to set the connection header for WebSocket proxying.
proxy_set_header Connection [1];The Connection header must be set to "Upgrade" (capital U) to properly establish a WebSocket connection.
Fix the error in the proxy_pass directive to correctly proxy WebSocket connections.
proxy_pass http://[1];The proxy_pass should point to the backend server's address and port without a URI path when proxying WebSocket connections to avoid URI rewriting issues.
Fill both blanks to correctly set headers for WebSocket proxying.
proxy_set_header Upgrade [1]; proxy_set_header Connection [2];
For WebSocket proxying, Upgrade header must be set to "upgrade" and Connection header to "Upgrade".
Fill all three blanks to complete the nginx location block for WebSocket proxying.
location /ws/ {
proxy_pass http://[1];
proxy_http_version [2];
proxy_set_header Upgrade [3];
}The proxy_pass points to the backend WebSocket server, proxy_http_version must be 1.1 for WebSocket support, and Upgrade header must be "WebSocket".