Test configuration

Validate nginx.conf without reloading

nginx -t

tool
nginx15 commands
tags
nginx

More nginx commands

  • nginx -s reload

    Gracefully reload config — zero connection drop

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

    List all built-in and dynamic modules in the binary

  • tail -f /var/log/nginx/access.log | awk '{print $1, $7, $9, $10}'

    Stream IP, path, status code, and response size

  • awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn

    Frequency of each HTTP status code in access log

  • awk '{print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -10

    Most popular request paths from access log

all 15 nginx commands