Test the configuration
Check the nginx config syntax without reloading
nginx -t
More nginx commands
-
nginx -s reloadReload the config gracefully without dropping open connections
-
nginx -V 2>&1 | tr ' ' '\n' | grep moduleList built-in and dynamic modules from the build options
-
tail -f /var/log/nginx/access.log | awk '{print $1, $7, $9, $10}'Stream client IP, path, status code and response size
-
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rnHow many times each HTTP status code appears in the access log
-
awk '{print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -10Most requested paths from the access log