Proxy WebSocket
WebSocket proxy with required Upgrade headers
location /ws/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
}
- tool
- nginx15 commands
More nginx commands
-
nginx -tValidate nginx.conf without reloading
-
nginx -s reloadGracefully reload config — zero connection drop
-
nginx -V 2>&1 | tr ' ' '\n' | grep moduleList all built-in and dynamic modules in the binary
-
tail -f /var/log/nginx/access.log | awk '{print $1, $7, $9, $10}'Stream IP, path, status code, and response size
-
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rnFrequency of each HTTP status code in access log