Amazon I am using Nginx web server version 1.4.6 after migrating from 1.4.1. I used the same Nginx configuration file and I kept getting this error in a web browser when I was trying to access a file in my web directory:
404 Not Found error on nginx/1.4.6 (Ubuntu)
But the file I am trying to access exists at the right location. Why was it working on Nginx 1.4.1 but not working on Nginx 1.4.6?
Solution
You must include the "root" directive inside the server block like so:
4 | root /home/ubuntu/repository/trunk; |
However, the "root" directive is not necessary inside the server block in the configuration file for nginx/1.4.1; you just need to include the root directive inside the "location" block. Why Nginx changed this behavior from 1.4.1 to 1.4.6 is beyond me.
Questions? Let me know!