Drupal7 doesn't generate Image style when filename contains "&" => error 404

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
heyyo's picture

I'm using NGINX Perusio configuration. It works great.
I just have an issue with some images with the character "&" inside filename.
Drupal returns an error 404 when browsing image styles version of those images.

When accessing the image directly without image styles it's working as expected.

I thought using LUA NGINX module will resolve my issue, but it doesn't seem the case.

set_by_lua $escaped_uri 'return ngx.escape_uri(ngx.var.uri)';
location / {
....
    location ~ ^/sites/.*/files/styles/ {
        try_files $escaped_uri @drupal;
    }
    ...
    try_files $escaped_uri @drupal;
}

Do you have clue how to solve this issue ?

Comments

I fixed my issue by

heyyo's picture

I fixed my issue by replacing:

In fastcgi_drupal.conf:
fastcgi_param QUERY_STRING q=$uri&$args;
by
fastcgi_param QUERY_STRING q=$escaped_uri&$args;

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: