]> git.openstreetmap.org Git - rails.git/commitdiff
nginx fix expiry to actually work on images/javascripts/etc
authorGrant Slater <openstreetmap@firefishy.com>
Tue, 21 Apr 2009 02:42:29 +0000 (02:42 +0000)
committerGrant Slater <openstreetmap@firefishy.com>
Tue, 21 Apr 2009 02:42:29 +0000 (02:42 +0000)
config/nginx.conf

index 1108be5dc4b9b295183b3c235ab719d0011f5d7f..1da97a6d549cbc69187f46f108ff6c223f084a64 100644 (file)
@@ -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 / {