2 # Load the modules that we need
17 # Basic server configuration
19 server.username = "www-data"
20 server.groupname = "www-data"
21 server.pid-file = "/var/run/lighttpd.pid"
26 accesslog.filename = "/var/log/lighttpd/access.log"
27 server.errorlog = "/var/log/lighttpd/error.log"
30 # Allow munin to monitor the server's status
32 $HTTP["remoteip"] == "127.0.0.1" { status.status-url = "/server-status" }
35 # Fail any attempt to access old versions of the API without
36 # getting rails involved at all
38 $HTTP["url"] =~ "^/api/0.3/" { url.access-deny = ("") }
39 $HTTP["url"] =~ "^/api/0.4/" { url.access-deny = ("") }
42 # IP blocked at SteveC's request as it was trying to download the
43 # history of every object in the database one at a time
45 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
48 # Rule to block tilesAtHome when somebody decides to queue vast
49 # number of tiles for rerendering
51 #$HTTP["useragent"] == "tilesAtHome" { url.access-deny = ("") }
54 # Limit connections to 20 per IP address
56 evasive.max-conns-per-ip = 20
59 # Setup MIME type mapping
63 ".gif" => "image/gif",
64 ".html" => "text/html",
65 ".js" => "application/x-javascript",
66 ".png" => "image/png",
67 ".swf" => "application/x-shockwave-flash",
68 ".txt" => "text/plain"
72 # Enable compression of appropriate static content
75 "application/x-javascript",
76 "application/x-shockwave-flash",
83 # Set expiry for static content
86 "/images/" => "access 10 years",
87 "/javascripts/" => "access 10 years",
88 "/openlayers/" => "access 10 years",
89 "/stylesheets/" => "access 10 years"
93 # Cache compressed content
95 compress.cache-dir = "/var/cache/lighttpd"
98 # Redirect trac and wiki requests to the right places
101 "^/trac/(.*)$" => "http://trac.openstreetmap.org/$1",
102 "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
106 # Run anything with a .pl iextension as a CGI script
108 cgi.assign = ( ".pl" => "/usr/bin/perl" )
111 # Serve static content from the rails public area ourselves
113 server.document-root = "/var/www/rails/public"
116 # Send everything else to the appropriate FastCGI server
118 server.error-handler-404 = "/dispatch.fcgi"
119 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
122 # Configure the FastCGI servers
126 ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
127 ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
128 ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
129 ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
130 ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
131 ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
134 ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
135 ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
136 ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )