Servers and cloud

Find nginx's logs and config, and reload it

Where nginx keeps its error log and config files, how to test a change and how to reload.

  1. Test the config (also shows its location)
    Terminal
    nginx -t
  2. Follow the error log
    Terminal
    tail -f /opt/homebrew/var/log/nginx/error.log
  3. Restart after changes
    Terminal
    brew services restart nginx
  1. Test the config (also shows its location)Needs sudo
    Terminal · Ubuntu / Debian
    sudo nginx -t

    Site configs live in /etc/nginx/sites-available/. The default web folder is /var/www/html.

  2. Follow the error logNeeds sudo
    Terminal · Ubuntu / Debian
    sudo tail -f /var/log/nginx/error.log
  3. Reload after changesNeeds sudo
    Terminal · Ubuntu / Debian
    sudo systemctl reload nginx

nginx is rarely run on Windows itself. Use it inside WSL (see Install WSL) and follow the Linux steps.