Magento – 403 error on WYSIWYG image previews

magento-1.9nginxpermissions

Whenever I open the WYSIWYG editor and try to add an image I get a bunnch of 403 errors in my chrome console and am unable to see the images.

GET https://www.example.com/media/wysiwyg/.thumbs/wysiwyg/homepage/parallax_banner_1.jpg?rand=1447169279 403 (Forbidden)

What's interesting is that I can still see the image in my browser window if I ammend the URL slightly by removing .thumbs/wysiwyg/ from the path:

https://www.example.com/media/wysiwyg/homepage/parallax_banner_3.jpg?rand=1447169279

I thought it could be a permissions issue but I tried setting media/wysiwyg/ to 777 recursively but the issue persists.

I'm running Magento 1.9.2.2 on an AWS EC2 instance, Ubuntu, NGINX.

Best Answer

This was due to the my NGINX configuration:

# Deny all attempts to access hidden files
# such as .htaccess, .htpasswd, etc...
location ~ /\. {
    deny all;
    access_log off;
    log_not_found off;
}

I was able to fix it by removing the above block and replacing it with:

location  /. { ## Disable .htaccess and other hidden files
    return 404;
}

As recommended on the Magento Wiki.