]> git.openstreetmap.org Git - rails.git/blobdiff - config/lighttpd.conf
Redirect to canonical hosts.
[rails.git] / config / lighttpd.conf
index 5cc3134b54b4e15b2aa48d6c28089d22a1438ce1..80b941fa6814a98f5dab3d9b72e9804fe3068e65 100644 (file)
@@ -20,6 +20,8 @@ server.username = "www-data"
 server.groupname = "www-data"
 server.pid-file = "/var/run/lighttpd.pid"
 
+server.max-fds = 8192
+
 #
 # Setup logging
 #
@@ -58,7 +60,7 @@ evasive.max-conns-per-ip = 20
 mimetype.assign = (
   ".css" => "text/css",
   ".gif" => "image/gif",
-  ".html" => "text/html",
+  ".html" => "text/html; charset=utf-8",
   ".js" => "application/x-javascript",
   ".png" => "image/png",
   ".swf" => "application/x-shockwave-flash",
@@ -108,6 +110,19 @@ url.redirect = (
   "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
 )
 
+#
+# Redirect everything except www.openstreetmap.org and
+# api.openstreetmap.org to www.openstreetmap.org
+#
+$HTTP["host"] =~ "^api\." {
+  $HTTP["host"] != "api.openstreetmap.org" {
+    url.redirect = ( "^(.*)$" => "http://api.openstreetmap.org$1" )
+  }
+}
+else $HTTP["host"] != "www.openstreetmap.org" {
+  url.redirect = ( "^(.*)$" => "http://www.openstreetmap.org$1" )
+} 
+
 #
 # Run anything with a .pl iextension as a CGI script
 #
@@ -124,13 +139,13 @@ server.document-root = "/home/rails/public"
 $HTTP["useragent"] == "tilesAtHome" {
   server.error-handler-404 = "/dispatch.tah"
 }
-else $HTTP["url"] =~ "^/api/0\.5/(map|trackpoints|amf|amf/read|swf/trackpoints)$" {
+else $HTTP["url"] =~ "^/api/0\.6/(map|trackpoints|amf|amf/read|swf/trackpoints)$" {
   server.error-handler-404 = "/dispatch.bulkapi"
 }
-else $HTTP["url"] =~ "^/api/0\.5/.*/search$" {
+else $HTTP["url"] =~ "^/api/0\.6/.*/search$" {
   server.error-handler-404 = "/dispatch.bulkapi"
 }
-else $HTTP["url"] =~ "^/api/0\.5/" {
+else $HTTP["url"] =~ "^/api/0\.6/" {
   server.error-handler-404 = "/dispatch.api"
 }
 else $HTTP["url"] =~ "^/api/0\.[0-9]+/" {