From 1f399ffd8591835c0315bae25c5f48f6060e12c7 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 21 Apr 2009 02:42:29 +0000 Subject: [PATCH] nginx fix expiry to actually work on images/javascripts/etc --- config/nginx.conf | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) 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 / { -- 2.43.2