"configuration file /etc/nginx/nginx.conf test failed": How do I know why this happened?

bernie2436 picture bernie2436 · Mar 10, 2014 · Viewed 114.3k times · Source

I'm an nginx noob trying out this this tutorial on nginx 1.1.19 on ubuntu 12.04. I have this nginx config file.

When I run this command the test fails:

$ sudo service nginx restart
Restarting nginx: nginx: [crit] pread() "/etc/nginx/sites-enabled/csv" failed (21: Is a directory)
nginx: configuration file /etc/nginx/nginx.conf test failed

How do I know why the nginx.conf test failed?

Answer

Mohammad AbuShady picture Mohammad AbuShady · Mar 10, 2014

sudo nginx -t should test all files and return errors and warnings locations