]> git.openstreetmap.org Git - rails.git/blobdiff - config/nginx.conf
Strip asset tags from public files.
[rails.git] / config / nginx.conf
index 1f94ee9d78b583d32e70c833014ebfbb8ca8ec4e..bd43f4c35bad85dfc5649b6c02a10962c2958234 100644 (file)
@@ -7,8 +7,7 @@ worker_processes  2;
 # Define PID files
 pid /var/run/nginx.pid;
 
-# Define log files
-access_log /var/log/nginx/access.log;
+# Define error log
 error_log /var/log/nginx/error.log;
 
 events {
@@ -26,6 +25,9 @@ http {
     keepalive_timeout 65;
     tcp_nodelay on;
 
+    # Define access log
+    access_log /var/log/nginx/access.log;
+
     # Configure compression (text/html is compressed by default)
     gzip on;
     gzip_min_length 1100;
@@ -146,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") {