search

Home  >  Q&A  >  body text

permission-denied - nginx open() "..." failed (13: Permission denied)

Use PHP to upload files, and then generate a thumbnail. The thumbnail access is normal, and the uploaded file access nginx prompts 403 error:

2014/12/19 14:41:41 [error] 19433#0: *16 open() "/var/www/uploads/files/gmail-theme-tree.png" failed (13: Permission denied)

View file permissions:

-rw-r--r--. 1 www-data www-data 178878 Dec 19 14:48 gmail-theme-tree.png
-rw-r--r--. 1 www-data www-data   2729 Dec 19 14:48 gmail-theme-tree-_x22.png

Above gmail-theme-tree-_x22.png The access is normal, gmail-theme-tree.png The access prompt is "403 Forbidden".

Ask for advice!

某草草某草草2781 days ago826

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 17:27:46

    1. Restart Nginx
    2. Check if Nginx is running as www-data
    3. Check if www-data is in /var/www/uploads/files/gmail-theme-tree.png Directories at all levels above have x permissions.

    reply
    0
  • Cancelreply