2 # Load the modules that we need
16 # Basic server configuration
18 server.username = "www-data"
19 server.groupname = "www-data"
20 server.pid-file = "/var/run/lighttpd.pid"
25 accesslog.filename = "/var/log/lighttpd/access.log"
26 server.errorlog = "/var/log/lighttpd/error.log"
29 # Allow munin to monitor the server's status
31 $HTTP["remoteip"] == "127.0.0.1" { status.status-url = "/server-status" }
34 # API 0.3 is long dead, so fail any attempt to access it without
35 # getting rails involved at all
37 $HTTP["url"] =~ "^/api/0.3/" { url.access-deny = ("") }
40 # IP blocked at SteveC's request as it was trying to download the
41 # history of every object in the database one at a time
43 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
46 # Rule to block tilesAtHome when somebody decides to queue vast
47 # number of tiles for rerendering
49 #$HTTP["useragent"] == "tilesAtHome" { url.access-deny = ("") }
52 # Limit connections to 20 per IP address
54 evasive.max-conns-per-ip = 20
57 # Setup MIME type mapping
61 ".gif" => "image/gif",
62 ".html" => "text/html",
63 ".js" => "application/x-javascript",
64 ".png" => "image/png",
65 ".swf" => "application/x-shockwave-flash",
66 ".txt" => "text/plain"
70 # Enable compression of appropriate static content
73 "application/x-javascript",
74 "application/x-shockwave-flash",
81 # Cache compressed content
83 compress.cache-dir = "/var/cache/lighttpd"
86 # Redirect trac and wiki requests to the right places
89 "^/trac/(.*)$" => "http://trac.openstreetmap.org/$1",
90 "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
94 # Run anything with a .pl iextension as a CGI script
96 cgi.assign = ( ".pl" => "/usr/bin/perl" )
99 # Serve static content from the rails public area ourselves
101 server.document-root = "/var/www/rails/public"
104 # Send everything else to the appropriate FastCGI server
106 server.error-handler-404 = "/dispatch.fcgi"
107 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
110 # Configure the FastCGI servers
114 ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
115 ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
116 ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
117 ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
118 ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
119 ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
122 ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
123 ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
124 ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )