Where Are nginx Config Files?
nginx.conf and sites layout on Linux, Windows and Homebrew Mac, plus the config test command.
Last updated
nginx reads one main config that includes the rest. Linux package layouts split sites across sites-available and sites-enabled; Windows and Homebrew keep it flatter.
Always test before reloading. The config test command names the file it actually read, which settles prefix disputes instantly.
Where nginx stores this, by platform
/etc/nginx/nginx.conf
Debian family adds sites-enabled includes; RHEL keeps conf.d. Run the test command with root to validate before reloading.
C:\nginx\conf\nginx.conf
ZIP install default; custom prefixes move it. Forward slashes work in the file even on Windows.
/opt/homebrew/etc/nginx/nginx.conf
Homebrew Apple Silicon path; Intel uses /usr/local/etc/nginx. The test command prints whichever prefix your binary uses.
Frequently asked questions
How do I find which config nginx really loaded?
Run the test command (lowercase t). Its first lines print the configuration file path it parsed.
Why is my new site file ignored?
On Debian layouts it must link into sites-enabled, not just sit in sites-available. Reload after linking.
Notice an outdated path? Let us know.