I have the following config files and locations:
etc/ngnix/nginix.conf
var/etc/nginx/sites-available/myproject
etc/ngnix/conf.d/default.conf
etc/ngnix/conf.d/web.conf
I'm confused regarding each conf file role, rules, when to use one or another, are they loaded one after another, or just one, are directives overwriting ?
The nginx
configuration file is called nginx.conf
and on most systems is located at etc/nginx/nginx.conf
.
nginx.conf
may optionally contain include
statements to read parts of the configuration from other files. See this document for more. Read your nginx.conf
file to identify which files and directories are sourced and in which context and which order.
Some distributions are delivered with an nginx.conf
file that sources additional files from directories such as /conf.d/
and /sites-enabled/
.
There is also a convention on some distributions to symlink files between /sites-available/
and /sites-enabled/
.
The nginx -T
command (uppercase T
) is useful to list the entire configuration across all the included files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With