I'm trying to serve a video file from a fresh nginx plus install on centos 7. I added the conf

server {
 listen 80;
 root /usr/share/nginx/html;
 location /video

The conf file is running on user nginx by default.

When I try to access, I get a forbidden 403, the error log as permission denied.

I have set owner/chmod to user nginx. The other static files in the same folder, t.html is served fine.

[root@localhost video]# ls -al
total 1820480
drwxrwxrwx. 2 root  root          31 Nov  6  2017 .
drwxr-xr-x. 4 root  root        4096 Nov  6  2017 ..
-rw-r--r--. 1 root  root           9 Nov  6  2017 t.html
-rwxrwxrwx. 1 nginx nginx 1864160493 Feb 14  2017 t.mp4

The error log

2017/11/06 06:54:04 [error] 2118#2118: *9 open() "/usr/share/nginx/html/video/t.mp4" failed (13: Permission denied), client:, server: localhost, request: "GET /video/t.mp4 HTTP/1.1", host: ""

it is selinux mode, need to disable it

  • It would be helpful if you could expand on your answer. – womble Nov 10 '17 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.