Answer the question
In order to leave comments, you need to log in
Why doesn't nginx list files in directories?
I don't understand what could be the problem.
There is a task using Nginx to publish several files. However, the list of directories is shown, but there are no files, while in the nginx error.log it is:
2018/05/30 07:33:38 [crit] 22491#22491: *1 stat() "/site/RPMS/file.txt" failed (13: Permission denied), client: 146.120.119.127, server: 35.207.49.222, request: "GET / HTTP/1.1", host: "35.207.49.222", referrer: "http://35.207.49.222/"
server {
listen 80;
server_name 35.207.49.222;
root /site/RPMS;
location / {
autoindex on;
}
}
namei -om /site/RPMS/file.txt
f: /site/RPMS/file.txt
dr-xr-xr-x root root /
drwxrwxrwx nginx nginx site
drwxr-xr-x nginx nginx RPMS
-rwxr-xr-x nginx nginx file.txt
ps aux | grep nginx
root 22490 0.0 0.1 46404 960 ? Ss 07:33 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 22491 0.0 0.3 46788 2156 ? S 07:33 0:00 nginx: worker process
Answer the question
In order to leave comments, you need to log in
Look. whether there are Execute rights on all parent directories... i.e. /site/RPMS/ and /site/
In general, the problem was in crooked hands. I disabled Selinux in /etc/sysconfig/selinux and the server didn't restart. After the reboot everything worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question