The nginx documentation states that a common use for the ‘=’ modifier is for handling requests to ‘/’. Using ‘= /’ in the location directive can expedite processing since it halts the match search after the first comparison. Here’s an example:
location = / {
#...
}
My configuration was:
location / {
root /usr/share/nginx/html/data/www;
index index.html index.htm;
}
This configuration worked well, but modifying it to:
location = / {
root /usr/share/nginx/html/data/www;
index index.html index.htm;
}
resulted in a 404 error. The error log indicated:
open() “/etc/nginx/html/index.html” failed (2: No such file or directory).
How can I fix it
excper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.