How to prevent nginx from appending the location to root? [duplicate]
- by simonszu
This question already has an answer here:
nginx location pathing issue
2 answers
I want to serve an Icinga Webview via nginx. This webview should be accessible via myserver.com/icinga (as the debian autoconfig for apache will do).
I have the following lines in my nginx config:
location /icinga {
root /usr/share/icinga/htdocs;
index index.html;
auth_basic "Restricted";
auth_basic_user_file /etc/icinga/htpasswd.users;
}
However, i get an error 404 and a log entry that says:
*10 open() "/usr/share/icinga/htdocs/icinga" failed (2: No such file or directory),
So it seems that nginx appends the location value to the root value. I think i figured it out how to prevent this some time ago, but i did not document it for myself and have forgotten how to do it. And now i can't fix it for myself. Can you tell me how to prevent this behaviour?