What is the NGinx 'directive not allowed here' error? I am trying to use NGinx for the first time, and within a Docker container, and I am using example configurations from other websites that seem to be correct configurations, but I get this error, no matter how I configure the nginx.conf file, and I don't know why.
2018/03/10 20:52:20 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/nginx.conf:6 nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/nginx.conf:6 Link to my Github project branch (not master) demonstrating the problem.
I have Googled this error and see lots of answers suggesting it is a simple fix and I have tried them all.
For example, if I configure my nginx.conf file like so, I get the error:
# nginx.conf user nobody;
nginx.conf(i.e./etc/nginx/nginx.conf), but some additional config file that gets loaded elsewhere (/etc/nginx/conf.d/...). What does the main config file contain?/etc/nginx/nginx.conf.