2 # Load the modules that we need
15 # Basic server configuration
17 server.username = "www-data"
18 server.groupname = "www-data"
19 server.pid-file = "/var/run/lighttpd.pid"
24 accesslog.filename = "/var/log/lighttpd/access.log"
25 server.errorlog = "/var/log/lighttpd/error.log"
28 # Allow munin to monitor the server's status
30 $HTTP["remoteip"] == "127.0.0.1" { status.status-url = "/server-status" }
33 # API 0.3 is long dead, so fail any attempt to access it without
34 # getting rails involved at all
36 $HTTP["url"] =~ "^/api/0.3/" { url.access-deny = ("") }
39 # IP blocked at SteveC's request as it was trying to download the
40 # history of every object in the database one at a time
42 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
45 # Rule to block tilesAtHome when somebody decides to queue vast
46 # number of tiles for rerendering
48 #$HTTP["useragent"] == "tilesAtHome" { url.access-deny = ("") }
51 # Limit connections to 20 per IP address
53 evasive.max-conns-per-ip = 20
56 # Setup MIME type mapping
60 ".gif" => "image/gif",
61 ".html" => "text/html",
62 ".js" => "application/x-javascript",
63 ".png" => "image/png",
64 ".swf" => "application/x-shockwave-flash",
65 ".txt" => "text/plain"
69 # Enable compression of appropriate static content
72 "application/x-javascript",
73 "application/x-shockwave-flash",
80 # Cache compressed content
82 compress.cache-dir = "/var/cache/lighttpd"
85 # Redirect wiki requests to the wiki
87 url.redirect = ( "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/wiki/$1" )
90 # Serve static content from the rails public area ourselves
92 server.document-root = "/var/www/rails/public"
95 # Send everything else to the appropriate FastCGI server
97 server.error-handler-404 = "/dispatch.fcgi"
98 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
101 # Configure the FastCGI servers
105 ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
106 ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
107 ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
108 ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
109 ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
110 ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
113 ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
114 ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
115 ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )