Network

The nginx command

Nginx web server. With -t it checks the config and with -s reload it reloads without downtime.

Syntax

nginx [-t | -s reload | -v]Try it in the terminal →

Most useful options

-tChecks the config
-s reloadReloads without downtime

Copy-ready examples

$ sudo nginx -tCheck the config

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Sites live in /etc/nginx/sites-available (server, server_name, root).

Related commands

FAQ

Does nginx -t change anything?

No, it only checks; to apply changes use nginx -s reload.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course