Drupal - Failing to create thumbnail, medium and large images

Right, the answer is in fact a little more subtle than I realised. Turns out that D7's imagecache replacement needs some attention in your nginx vhost. Without the 404s being sent to Drupal for the missing files, the images are not created - something I didn't realise initially, as I'd assumed they were created on upload.

location @rewrite {
    rewrite ^/(.*)$ /index.php?q=$1;
}

location ~ ^/sites/.*/files/styles/ {
    try_files $uri @rewrite;
}

It needs to be added to your server definition, and you should be ready to roll. Clearly, the path may need altering for your setup, but for mine it was.


Be sure to check both the public file system path and the temporary path at admin/config/media/file-system

Once I had both of those folders set with the correct permissions, my subfolders are automatically created when I save a file, the image is saved, and the error message is gone :-)


In my case the issue was causing because the images were fetched using https,

I added the following lines on the secure page settings to ignore https on file paths.

*/files/*

Hope this helps someone. :)

Tags:

Media

7