Recall & Review
beginner
What does the command
nginx -t do?It checks the syntax of the nginx configuration files without starting the server. It helps find errors before applying changes.
Click to reveal answer
beginner
Why is it important to run
nginx -t before restarting nginx?Because it ensures the configuration files have no syntax errors, preventing nginx from failing to start or crashing.
Click to reveal answer
beginner
What output indicates a successful configuration test with
nginx -t?You will see messages like:<br>
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br>and<br>nginx: configuration file /etc/nginx/nginx.conf test is successfulClick to reveal answer
intermediate
If
nginx -t reports an error, what should you do?Read the error message carefully to find the file and line number causing the problem, then fix the syntax error before testing again.
Click to reveal answer
beginner
Can
nginx -t apply configuration changes to the running server?No, it only tests the configuration syntax. To apply changes, you must reload or restart nginx after a successful test.
Click to reveal answer
What does the
-t option do in the nginx command?✗ Incorrect
The
-t option checks the configuration files for syntax errors without starting the server.What should you do if
nginx -t shows a syntax error?✗ Incorrect
You must fix the syntax error before restarting or reloading nginx to avoid failures.
Which message indicates a successful nginx configuration test?
✗ Incorrect
The message confirms the syntax is correct and the test succeeded.
Does
nginx -t apply configuration changes to the running server?✗ Incorrect
Testing does not change the running server; you must reload or restart nginx separately.
Where does
nginx -t look for configuration files by default?✗ Incorrect
By default, nginx tests the main configuration file located at /etc/nginx/nginx.conf.
Explain the purpose and typical usage of the
nginx -t command.Think about how you check a recipe before cooking.
You got /4 concepts.
Describe the steps you take if
nginx -t reports a syntax error.Like proofreading a letter before sending it.
You got /4 concepts.