I am using nginx on Mac, I installed it using Homebrew, and it used to work fine until this morning. Now, after a reboot, it doesn't read my nginx.conf (from /usr/local/etc/nginx/nginx.conf) anymore and loads its default index.html from /usr/local/var/www. If I force pass the config file explicitly using -c switch (sudo nginx -c /usr/local/etc/nginx/nginx.conf), nginx runs fine. Yesterday, I ran (python's) SimpleHTTPServer to serve a file and test something, then quit, and shut down. SimpleHTTPServer is not running anymore, I just ran it a couple of times yesterday. I don't know if the issue is related to that, but just in case. lsof does not show any process running on ports 80 or 443 except nginx.
Update:
In my nginx.conf, I serve files from different directories in a specified order (some directories are sym-linked):
location ~ ^/(js/|css/|img/|audio/|fonts/|files/|images/|video/) {
root /Users/me/development/myCompany;
try_files /staticFrontend/$uri /angularjsSPA/develop/$uri =404;
}
Again sudo nginx -c /usr/local/etc/nginx/nginx.conf works fine, but sudo nginx does not.
strace nginxon my Linux machine I getopen("/etc/nginx/nginx.conf", O_RDONLY) = 3which tells me where the default configuration file llives.