0

I'm having this strange problem in my wordpress installation on a server that uses Nginx:

When I upload an image through the media library, everything seems to go fine (file is saved, miniatures are created, ...) except that when I try to show the original uploaded image it returns a 403 (forbidden) error. Permissions and user for both containg folder and the file itself are correct, and, in fact, all miniatures created by wordpress (in the same folder) are displayed correctly, so i.e. /wp-content/uploads/2016/08/image1.jpg shows the error but /wp-content/uploads/2016/08/image1-200x200.jpg shows the image.

I tried disabling Nginx and using Apache and then all works fine and the original uploaded images are served without error... but I really would like to make it work with Nginx. Any ideas?

Daniel Ferradal
  • 2,727
  • 1
  • 13
  • 19
Borgtex
  • 3,235
  • 1
  • 19
  • 28
  • try comparing the owner/group and file permission between image1.jpg vs image1-200x200.jpg – silver Aug 23 '16 at 15:44
  • Yep, that's one of the first things I did. All files have the same owner, group and file permissions; that's why it's so strange. – Borgtex Aug 23 '16 at 16:32
  • check the error and nginx log, you might also want to post your whole nginx config, try to access both file also using curl, and see what response you'd get. – silver Aug 23 '16 at 19:23
  • There was no relevant information in the nginx logs, and curl produced the same problem. Rather than with wordpress, seems to be a problem with php moving files from the tmp folder. Reformulated the question at: http://stackoverflow.com/questions/39149148/move-uploaded-file-creating-unaccessible-403-forbidden-files-under-nginx – Borgtex Aug 25 '16 at 15:32

0 Answers0