Test the configuration

Check the nginx config syntax without reloading

nginx -t

tool
nginx15 commands
tags
nginx

More nginx commands

  • nginx -s reload

    Reload the config gracefully without dropping open connections

  • nginx -V 2>&1 | tr ' ' '\n' | grep module

    List 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 -rn

    How 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 -10

    Most requested paths from the access log

all 15 nginx commands