Every time if I put a file into the doc dir of nginx by using the mv
command, it always results in a 403 Forbidden
error, but if I do that by using the cp
command, no error occurs.
I tried very large and very small files, and tried putting files whether or not nginx is alive, and tried clearing the cache dir of nginx, but the problem still raised.
Has someone resolved a problem like this?
Probably it is a problem of UNIX permissions and ownership.
mv
can preserve ownership of file in situation wherecp
can't, e.g. when you use it as unprivileged user. Cf. this question.To check the ownership of files you can do:
or use
stat
for single files.