ISPA Winner 2018 16 Years of Krystal

Web Hosting

Please find below our list of Web Hosting guides to help with your hosting account.

Drupal denies permission to styled images

This article was posted in: Web Hosting

Late in 2016 Krystal switched to using Varnish as a reverse proxy to accelerate the serving of static resources. Part of the Varnish configuration involves the removal of parameters from statc resource requests.

For example, the request:

will be received by Varnish, and before it is passed to Apache, the URL parameters ?id=23Hg will be stripped off, so what actually gets passwoed to Apache is:

Normally, this causes no porblems with most applications, but drupal (due to the way it tries to prevent certain kinds of exploits) relies on the extra parameters, and will reject the request without them.

To avoid this, you have two choices:

1.) Disable Varnish cache in your cPanel account (not recommended for performance reasons)

2.) Add or edit the following setting to your Drupal installation's settings.php file

$conf['image_allow_insecure_derivatives'] = TRUE;