]> git.openstreetmap.org Git - rails.git/blobdiff - config/nginx.conf
Restrict 7 day expiry on /export to just the embed.html page.
[rails.git] / config / nginx.conf
index b9055c2d38bb951717ce880e5ef1b1f2c53f5441..d63b82b6f0fa74610667ee1e0c8ab57a01fd3022 100644 (file)
@@ -148,6 +148,11 @@ http {
             rewrite ^/(0\.[0-9]+)/(.*)$ /api/$1/$2;
         }
     
+        # Strip asset tags
+        location ~ ^/(images|javascripts|openlayers|stylesheets)/ {
+            rewrite ^/(.*)/[0-9]+$ /$1;
+        }
+
         # Handle tiles@home requests
         location /api/ {
             if ($http_user_agent ~ "^tilesAtHome") {
@@ -183,11 +188,14 @@ http {
 
         # Deny old and unknown API versions
         location ~ ^/api/0\.[0-9]+/ {
-            deny all;
+            return 404;
         }
             
         # Handle Special Case Expiry
-        location ~ ^/(export|openlayers)/ {
+        location ~ ^/openlayers/ {
+            expires 7d;
+        }
+        location ~ ^/export/embed.html$ {
             expires 7d;
         }
         location ~ ^/(images|javascripts|stylesheets)/ {