Loading tool…
cheatsheet
sudo systemctl start nginxStart Nginx
sudo systemctl stop nginxStop Nginx
sudo systemctl restart nginxRestart Nginx
sudo systemctl reload nginxReload config without dropping connections
nginx -tTest configuration file syntax
nginx -s reloadReload configuration (alternative to systemctl)
listen 80;Listen on port 80
server_name example.com;Set the server name/domain to match
root /var/www/html;Set the document root directory
index index.html;Set the default index file
proxy_pass http://backend;Proxy requests to a backend server
return 301 https://$host$request_uri;Redirect HTTP to HTTPS
tail -f /var/log/nginx/access.logFollow the access log in real time
tail -f /var/log/nginx/error.logFollow the error log in real time
Get new cheatsheets & tools in your inbox
No spam — just new releases, occasionally.