Nginx 1 · Reverse proxy and TLS

Proxy WebSockets

Pass the upgrade headers so WebSocket connections work through the proxy.

location /ws/ {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

Official Nginx 1 documentation

More reverse proxy and tls commands

All reverse proxy and tls commands · Nginx 1 cheatsheet

Was this page helpful?