Block IP range nginx
Block a subnet and specific IP in nginx location/server block
deny 192.168.1.0/24;
deny 10.0.0.1;
allow all;
more nginx
all 15 commands →
Proxy WebSocket
location /ws/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
}
Test configuration
nginx -t
Reload without downtime
nginx -s reload
Show compiled modules
nginx -V 2>&1 | tr ' ' '\n' | grep module
Tail access log with fields
tail -f /var/log/nginx/access.log | awk '{print $1, $7, $9, $10}'