Nginx Commands

Complete Nginx commands reference — 25 commands across 3 categories. Quick reference cheat sheet for Linux & Unix.

Command Line Switches (12)

ShortcutAction
nginx -hprint help for command-line parameters
nginx -c fileuse an alternative configuration file instead of a default file
nginx -e fileuse an alternative error log file to store the log instead of a default file (1.19.5)
nginx -g directivesset global configuration directives, for example, nginx -g "pid /var/run/nginx.pid
nginx -l portenable nginx control REST API on a specified port or UNIX-domain socket (1.29.8). This
nginx -p prefixset nginx path prefix, i.e. a directory that will keep server files
nginx -qsuppress non-error messages during configuration testing
nginx -s signalsend a signal to the master process. The argument signal can be one of: stop - shut down
nginx -ttest the configuration file: nginx checks the configuration for correct syntax, and then tries
nginx -Tsame as -t, but additionally dump configuration files to standard output (1.9.2)
nginx -vprint nginx version
nginx -Vprint nginx version, compiler version, and configure parameters

Process Signals (6)

ShortcutAction
kill -TERMFast shutdown
kill -QUITGraceful shutdown
kill -HUPChanging configuration, keeping up with a changed time zone (only for FreeBSD and Linux)
kill -USR1Re-opening log files
kill -USR2Upgrading an executable file
kill -WINCHGraceful shutdown of worker processes

Additional Commands (7)

ShortcutAction
nginx -s reloadReload config
nginx -s stopStop server
nginx -s quitGraceful stop
systemctl status nginxCheck status
systemctl restart nginxRestart
tail -f /var/log/nginx/access.logAccess log
tail -f /var/log/nginx/error.logError log
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Related Shortcut Pages

Docker systemctl / systemd Linux Ansible Vagrant Proxmox VE

Search 13,500+ shortcuts across 269 platforms

Explore All Platforms Practice Shortcuts
📜 Every shortcut on this page is taken from the official Nginx documentation — nginx.org

🤖 Ask AI about Nginx shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.