imagecache icon indicating copy to clipboard operation
imagecache copied to clipboard

Please add Nginx config notes in README

Open IgorUsoltsev opened this issue 5 years ago • 1 comments

I had a problem on my live Nginx server - cache routes gave me 404.

The issue appears when you have static resources caching enabled for media files. F.e. this config in nginx.conf file will lead to conflict with your module:

location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|webp|woff|woff2)$ {
  expires max;
  access_log off;
  add_header Cache-Control "public";
}

You have to change this to exclude your {route} directory:

# where "cache" is {route}
location ~* ^\/(?!cache).*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|webp|woff|woff2)$ {
  expires max;
  access_log off;
  add_header Cache-Control "public";
}

IgorUsoltsev avatar Dec 07 '20 09:12 IgorUsoltsev

I have opened PR for this - https://github.com/Intervention/imagecache/pull/122

IgorUsoltsev avatar Dec 07 '20 09:12 IgorUsoltsev