From: Grant Slater Date: Tue, 21 Apr 2009 02:42:29 +0000 (+0000) Subject: nginx fix expiry to actually work on images/javascripts/etc X-Git-Tag: live~7535 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1f399ffd8591835c0315bae25c5f48f6060e12c7 nginx fix expiry to actually work on images/javascripts/etc --- diff --git a/config/nginx.conf b/config/nginx.conf index 1108be5dc..1da97a6d5 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -158,6 +158,16 @@ http { # Strip asset tags location ~ ^/(images|javascripts|openlayers|stylesheets|user/image)/ { rewrite ^/(.*)/[0-9]+$ /$1; + expires max; + + # Handle Special Case Expiry + if ($uri ~ ^/openlayers/) { + expires 7d; + } + } + # Handle Special Case Expiry + location ~ ^/export/embed.html$ { + expires 7d; } # Include fastcgi configuration @@ -205,17 +215,6 @@ http { return 404; } - # Handle Special Case Expiry - location ~ ^/openlayers/ { - expires 7d; - } - location ~ ^/export/embed.html$ { - expires 7d; - } - location ~ ^/(images|javascripts|stylesheets)/ { - expires max; - } - # Send everything else to the web backend unless it exists # in the rails public tree location / {