Services and User Management

After editing /etc/nginx/nginx.conf, an administrator wants to check the configuration for syntax errors without affecting the running service. Which command should be used?

Show the answer

Correct answerB. nginx -t

AWhy not this: nginx -s reload signals the running master to load the new configuration, which affects the service.

BWhy this is right: Nginx -t parses the configuration and reports errors without touching the running service.

CWhy not this: A restart stops and starts the service, and a bad configuration would leave it down.

DWhy not this: nginx -V prints the version and build options; it does not check the configuration.

nginx -t parses the configuration and reports syntax errors or success without applying anything to the running service. It is commonly run before systemctl reload nginx. It does not reload the configuration itself.