0
0
Nginxdevops~5 mins

Configuration testing (nginx -t) - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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 successful
Click 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?
AStops nginx service
BStarts nginx in test mode
CTests the configuration syntax without starting nginx
DDisplays nginx version
What should you do if nginx -t shows a syntax error?
AIgnore it and restart nginx
BFix the error in the configuration file and test again
CUninstall nginx
DRun <code>nginx -s reload</code> immediately
Which message indicates a successful nginx configuration test?
Anginx: configuration file test failed
Bnginx: service stopped
Cnginx: unknown command
Dnginx: the configuration file syntax is ok
Does nginx -t apply configuration changes to the running server?
ANo, it only tests the configuration syntax
BYes, it reloads nginx automatically
CYes, it restarts nginx
DNo, it stops nginx
Where does nginx -t look for configuration files by default?
A/etc/nginx/nginx.conf
B/usr/local/nginx/conf/nginx.conf
C/var/www/html/index.html
D/home/nginx/config.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.