Welcome! Log In Create A New Profile

Advanced

Expires headers for url rewrite rules

October 21, 2013 05:52AM
In my config I have some url rewrite rules for images as seen below:

location / {
rewrite ^/custom/path/(.*)/(.*)-(.*).jpg$ /media/images/products/$1/$3.jpg last;
}

They work just fine. I'm also trying to set Expire headers for all static resources (images, css, js). I've added the following block for that:

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 1y;
}

This works fine for everything except for the images that have the url rewrite rules (which return 404 Not found). Anyone know what I'm doing wrong here?

Thanks
Subject Author Posted

Expires headers for url rewrite rules

bogdanb October 21, 2013 05:52AM

Re: Expires headers for url rewrite rules

Francis Daly October 21, 2013 06:00AM

Re: Expires headers for url rewrite rules

bogdanb October 21, 2013 06:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 91
Record Number of Users: 6 on August 08, 2016
Record Number of Guests: 386 on August 02, 2016
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready