Force HTTPS redirect nginx
Permanent redirect all HTTP traffic to HTTPS
server {
listen 80;
return 301 https://$host$request_uri;
}
more nginx
all 15 commands →
Show active connections
curl -s http://localhost/stub_status
Block IP range
deny 192.168.1.0/24;
deny 10.0.0.1;
allow all;
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