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"
23 server.reject-expect-100-with-417 = "disable"
28 accesslog.filename = "/var/log/lighttpd/access.log"
29 server.errorlog = "/var/log/lighttpd/error.log"
32 # Allow munin to monitor the server's status
34 $HTTP["remoteip"] == "128.40.168.98" {
35 status.config-url = "/server-config"
36 status.status-url = "/server-status"
37 status.statistics-url = "/server-statistics"
41 # IP blocked at SteveC's request as it was trying to download the
42 # history of every object in the database one at a time
44 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
47 # Rule to block tilesAtHome when somebody decides to queue vast
48 # number of tiles for rerendering
50 #$HTTP["useragent"] == "tilesAtHome" { url.access-deny = ("") }
53 # Limit connections to 20 per IP address
55 evasive.max-conns-per-ip = 20
58 # Setup MIME type mapping
62 ".gif" => "image/gif",
63 ".html" => "text/html; charset=utf-8",
64 ".jpg" => "image/jpeg",
65 ".js" => "application/x-javascript",
66 ".png" => "image/png",
67 ".swf" => "application/x-shockwave-flash",
68 ".txt" => "text/plain",
73 # Force special MIME type for crossdomain.xml files
75 $HTTP["url"] =~ "/crossdomain\.xml$" {
76 mimetype.assign = ( ".xml" => "text/x-cross-domain-policy" )
80 # Enable compression of appropriate static content
83 "application/x-javascript",
84 "application/x-shockwave-flash",
91 # Set expiry for static content
94 "/export/embed.html" => "access 7 days",
95 "/images/" => "access 10 years",
96 "/javascripts/" => "access 10 years",
97 "/openlayers/" => "access 7 days",
98 "/stylesheets/" => "access 10 years"
102 # Cache compressed content
104 compress.cache-dir = "/var/cache/lighttpd"
107 # Redirect trac and wiki requests to the right places
110 "^/trac/(.*)$" => "http://trac.openstreetmap.org/$1",
111 "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
115 # Redirect everything except www.openstreetmap.org and
116 # api.openstreetmap.org to www.openstreetmap.org
118 $HTTP["host"] =~ "^api\." {
119 $HTTP["host"] != "api.openstreetmap.org" {
120 url.redirect = ( "^(.*)$" => "http://api.openstreetmap.org$1" )
123 else $HTTP["host"] != "www.openstreetmap.org" {
124 url.redirect = ( "^(.*)$" => "http://www.openstreetmap.org$1" )
128 # Run anything with a .pl iextension as a CGI script
130 cgi.assign = ( ".pl" => "/usr/bin/perl" )
133 # Serve static content from the rails public area ourselves
135 server.document-root = "/home/rails/public"
138 # Send everything else to the appropriate FastCGI server
140 $HTTP["useragent"] =~ "^tilesAtHome" {
141 server.error-handler-404 = "/dispatch.tah"
143 else $HTTP["url"] =~ "^/api/0\.6/(map|trackpoints|amf|amf/read|swf/trackpoints|changeset/[0-9]+/upload)$" {
144 server.error-handler-404 = "/dispatch.bulkapi"
146 else $HTTP["url"] =~ "^/api/0\.6/.*/(full|search)$" {
147 server.error-handler-404 = "/dispatch.bulkapi"
149 else $HTTP["url"] =~ "^/api/0\.6/" {
150 server.error-handler-404 = "/dispatch.api"
152 else $HTTP["url"] =~ "^/api/0\.[0-9]+/" {
153 url.access-deny = ("")
155 else $HTTP["url"] =~ "^/geocoder/(search|description)_osm_namefinder$" {
156 server.error-handler-404 = "/dispatch.namefinder"
158 else $HTTP["url"] =~ "^/geocoder/(search|description)_geonames$" {
159 server.error-handler-404 = "/dispatch.geonames"
161 else $HTTP["url"] =~ "^/" {
162 server.error-handler-404 = "/dispatch.web"
166 # Configure the FastCGI servers
170 ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
171 ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
172 ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
173 ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
174 ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
175 ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" ),
176 ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
177 ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
178 ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" ),
179 ( "host" => "127.0.0.1", "port" => 8009, "check-local" => "disable" ),
180 ( "host" => "127.0.0.1", "port" => 8010, "check-local" => "disable" ),
181 ( "host" => "127.0.0.1", "port" => 8011, "check-local" => "disable" ),
182 ( "host" => "127.0.0.1", "port" => 8012, "check-local" => "disable" ),
183 ( "host" => "127.0.0.1", "port" => 8013, "check-local" => "disable" ),
184 ( "host" => "127.0.0.1", "port" => 8014, "check-local" => "disable" ),
185 ( "host" => "127.0.0.1", "port" => 8015, "check-local" => "disable" ),
186 ( "host" => "127.0.0.1", "port" => 8016, "check-local" => "disable" ),
187 ( "host" => "127.0.0.1", "port" => 8017, "check-local" => "disable" ),
188 ( "host" => "127.0.0.1", "port" => 8018, "check-local" => "disable" ),
189 ( "host" => "127.0.0.1", "port" => 8019, "check-local" => "disable" ),
190 ( "host" => "127.0.0.1", "port" => 8020, "check-local" => "disable" ),
191 ( "host" => "127.0.0.1", "port" => 8021, "check-local" => "disable" ),
192 ( "host" => "127.0.0.1", "port" => 8022, "check-local" => "disable" ),
193 ( "host" => "127.0.0.1", "port" => 8023, "check-local" => "disable" ),
194 ( "host" => "127.0.0.1", "port" => 8024, "check-local" => "disable" ),
195 ( "host" => "127.0.0.1", "port" => 8025, "check-local" => "disable" )
198 ( "host" => "127.0.0.1", "port" => 8026, "check-local" => "disable" ),
199 ( "host" => "127.0.0.1", "port" => 8027, "check-local" => "disable" ),
200 ( "host" => "127.0.0.1", "port" => 8028, "check-local" => "disable" ),
201 ( "host" => "127.0.0.1", "port" => 8029, "check-local" => "disable" )
204 ( "host" => "127.0.0.1", "port" => 8030, "check-local" => "disable" ),
205 ( "host" => "127.0.0.1", "port" => 8031, "check-local" => "disable" ),
206 ( "host" => "127.0.0.1", "port" => 8032, "check-local" => "disable" ),
207 ( "host" => "127.0.0.1", "port" => 8033, "check-local" => "disable" )
210 ( "host" => "127.0.0.1", "port" => 8030, "check-local" => "disable" ),
211 ( "host" => "127.0.0.1", "port" => 8031, "check-local" => "disable" ),
212 ( "host" => "127.0.0.1", "port" => 8032, "check-local" => "disable" ),
213 ( "host" => "127.0.0.1", "port" => 8033, "check-local" => "disable" ),
214 ( "host" => "127.0.0.1", "port" => 8034, "check-local" => "disable" ),
215 ( "host" => "127.0.0.1", "port" => 8035, "check-local" => "disable" ),
216 ( "host" => "127.0.0.1", "port" => 8036, "check-local" => "disable" ),
217 ( "host" => "127.0.0.1", "port" => 8037, "check-local" => "disable" ),
218 ( "host" => "127.0.0.1", "port" => 8038, "check-local" => "disable" ),
219 ( "host" => "127.0.0.1", "port" => 8039, "check-local" => "disable" ),
220 ( "host" => "127.0.0.1", "port" => 8040, "check-local" => "disable" ),
221 ( "host" => "127.0.0.1", "port" => 8041, "check-local" => "disable" ),
222 ( "host" => "127.0.0.1", "port" => 8042, "check-local" => "disable" ),
223 ( "host" => "127.0.0.1", "port" => 8043, "check-local" => "disable" ),
224 ( "host" => "127.0.0.1", "port" => 8044, "check-local" => "disable" )
227 ( "host" => "10.0.0.10", "port" => 8000, "check-local" => "disable" ),
228 ( "host" => "10.0.0.11", "port" => 8000, "check-local" => "disable" ),
229 ( "host" => "10.0.0.12", "port" => 8000, "check-local" => "disable" ),
230 ( "host" => "10.0.0.10", "port" => 8001, "check-local" => "disable" ),
231 ( "host" => "10.0.0.11", "port" => 8001, "check-local" => "disable" ),
232 ( "host" => "10.0.0.12", "port" => 8001, "check-local" => "disable" ),
233 ( "host" => "10.0.0.10", "port" => 8002, "check-local" => "disable" ),
234 ( "host" => "10.0.0.11", "port" => 8002, "check-local" => "disable" ),
235 ( "host" => "10.0.0.12", "port" => 8002, "check-local" => "disable" ),
236 ( "host" => "10.0.0.10", "port" => 8003, "check-local" => "disable" ),
237 ( "host" => "10.0.0.11", "port" => 8003, "check-local" => "disable" ),
238 ( "host" => "10.0.0.12", "port" => 8003, "check-local" => "disable" ),
239 ( "host" => "10.0.0.10", "port" => 8004, "check-local" => "disable" ),
240 ( "host" => "10.0.0.11", "port" => 8004, "check-local" => "disable" ),
241 ( "host" => "10.0.0.12", "port" => 8004, "check-local" => "disable" ),
242 ( "host" => "10.0.0.10", "port" => 8005, "check-local" => "disable" ),
243 ( "host" => "10.0.0.11", "port" => 8005, "check-local" => "disable" ),
244 ( "host" => "10.0.0.12", "port" => 8005, "check-local" => "disable" ),
245 ( "host" => "10.0.0.10", "port" => 8006, "check-local" => "disable" ),
246 ( "host" => "10.0.0.11", "port" => 8006, "check-local" => "disable" ),
247 ( "host" => "10.0.0.12", "port" => 8006, "check-local" => "disable" ),
248 ( "host" => "10.0.0.10", "port" => 8007, "check-local" => "disable" ),
249 ( "host" => "10.0.0.11", "port" => 8007, "check-local" => "disable" ),
250 ( "host" => "10.0.0.12", "port" => 8007, "check-local" => "disable" ),
251 ( "host" => "10.0.0.10", "port" => 8008, "check-local" => "disable" ),
252 ( "host" => "10.0.0.11", "port" => 8008, "check-local" => "disable" ),
253 ( "host" => "10.0.0.12", "port" => 8008, "check-local" => "disable" ),
254 ( "host" => "10.0.0.10", "port" => 8009, "check-local" => "disable" ),
255 ( "host" => "10.0.0.11", "port" => 8009, "check-local" => "disable" ),
256 ( "host" => "10.0.0.12", "port" => 8009, "check-local" => "disable" ),
257 ( "host" => "10.0.0.10", "port" => 8010, "check-local" => "disable" ),
258 ( "host" => "10.0.0.11", "port" => 8010, "check-local" => "disable" ),
259 ( "host" => "10.0.0.12", "port" => 8010, "check-local" => "disable" ),
262 ( "host" => "10.0.0.10", "port" => 8011, "check-local" => "disable" ),
263 ( "host" => "10.0.0.11", "port" => 8011, "check-local" => "disable" ),
264 ( "host" => "10.0.0.12", "port" => 8011, "check-local" => "disable" )