DEV Community

Neeraj Sharma
Neeraj Sharma

Posted on

NGINX configuration for WebSocket

location /ws/websocket/ {
    proxy_pass http://localhost:8000;  # port where server is running
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 86400;
    proxy_redirect off;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)