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?
Through a simple command you can verify the status of the Nginx configuration file: $ sudo systemctl config nginx The output will show if the configuration file is correct or, if it is not, it will show the file and the line where the problem is.
By default, the configuration file is named nginx. conf and placed in the directory /usr/local/nginx/conf , /etc/nginx , or /usr/local/etc/nginx .
In addition to @Daniel Li's answer, the nginx installation with Valet would use the Velet configuration as well; this is found in /usr/local/etc/nginx/valet/valet. conf . The nginx. conf file would have imported this Valet conf file.
sudo nginx -t
should test all files and return errors and warnings locations
This particular commands worked for me. sudo apt-get remove --purge nginx nginx-full nginx-common
and sudo apt-get install nginx
credit to this answer on stackexchnage
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