Nginx · The edge of your stack
Where does Nginx keep its configuration and files after installation?
Short answer
The main config is usually /etc/nginx/nginx.conf, with includes from conf.d or sites-enabled. Logs go to /var/log/nginx, content roots vary by distribution, and the binary is /usr/sbin/nginx.
Package layouts differ slightly between Debian and RHEL families, but the main file and include pattern are predictable. Knowing the layout matters because most production changes happen in included files, not the main config.
/etc/nginx/nginx.conf
/etc/nginx/conf.d/*.conf
/etc/nginx/sites-available/*
/etc/nginx/sites-enabled/*
/etc/nginx/mime.types
/var/log/nginx/access.log
/var/log/nginx/error.log
/usr/share/nginx/html
/var/www/html
/usr/sbin/nginx- Debian keeps available sites separate and symlinks enabled ones into sites-enabled
- RHEL and Alpine commonly include /etc/nginx/conf.d/*.conf directly
- The default site usually lives in sites-enabled/default or conf.d/default.conf
- The effective config can be dumped with nginx -T for review
After changing config, validate with nginx -t before reloading. A syntax error should never reach a reload, because the master rejects an invalid config and keeps the old one running.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What is the difference between sites-available and sites-enabled?
- 2How do you check which config files Nginx actually loaded?
- 3What does nginx -t validate?
- 4Why might a config change have no effect after editing a file?
Say it in the interview
On a normal package install the main config is /etc/nginx/nginx.conf with includes from conf.d or sites-enabled, logs are under /var/log/nginx, and the web root is usually /var/www/html or /usr/share/nginx/html. I validate with nginx -t, inspect the merged config with nginx -T, and in containers I check the entrypoint and template paths first because the layout differs.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Nginx mock interview and get scored feedback on depth, clarity and confidence.