perusio / drupal-with-nginx

Running Drupal using nginx: an idiosyncratically crafted bleeding edge configuration.
854 stars 246 forks source link

Escaped URIs don't work #194

Open fearlsgroove opened 9 years ago

fearlsgroove commented 9 years ago

Seems at least with the version of ubuntu (14.04) and nginx (1.6.2) that the solution for escaped URIs doesn't work -- it escapes the entire URI including path separators, leading try files to pass off to PHP for image styles (and presumably adv agg, etc)

This fixed the issue for me -- escaping only the filename:

set_by_lua $escaped_uri 'return string.gsub(ngx.var.uri, ngx.var.request_filename, ngx.escape_uri(ngx.var.request_filename))';
dasrecht commented 9 years ago

thanks for this! :+1:

ran into the escaping issue too and swapped to escaping only the filename. @perusio can you merge that in?

derekjhunt commented 9 years ago

Yes, thanks for this! Advagg didn't work properly until I used this setting.