Answer the question
In order to leave comments, you need to log in
Nginx returns 403 when index is present?
I'm not strong in nginx, today I ran into a small problem.
If you specify:
location / {
root /home/www/site.ru;
index index.html index.htm;
}
location / {
root /home/anotheruser/repos/site.ru;
index index.html index.htm;
}
Answer the question
In order to leave comments, you need to log in
403 - access denied.
Maybe the user under which nginx is running does not have permission to read /home/anotheruser/repos/site.ru?
Miracles don't happen. See chmod, chown, acl, apparmor, selinux. Also, Anginix does not always follow symlinks and hardlinks, I don’t remember the conditions.
Why not add the user nginx is running as to the group your mercurial is running as? This is exactly what you want.
rights are available, 755 to all folders starting from /home/anotheruser and ending with /home/anotheruser/repos/site.ru
And yet, most likely, the rights to one of the parent folders are not set.
If at least one of them the user on behalf of which nginx is running does not have read rights, then there will be a 403.
Temporarily solved the problem - in .hg / hgrc of the project I wrote:
[hooks]
changegroup = hg update >&2 && cp -R /home/hg/repos/site.ru/* /home/www/site.ru >&2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question