How to enable Web Socket in Nginx

Natthapon Pinyo
1 min readJan 24, 2019

--

1. Add HTTP & Header Configuration to nginx.conf

location /live {
proxy_pass http://127.0.0.1:4200
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

}

2. Restart Nginx

$ sudo systemctl restart nginx

Reference: https://nginx.org/en/docs/http/websocket.html

--

--

Natthapon Pinyo
Natthapon Pinyo

No responses yet