]> git.openstreetmap.org Git - rails.git/blob - config/lighttpd.conf
Fix alignment of greeting in top right corner of site.
[rails.git] / config / lighttpd.conf
1 #
2 # Load the modules that we need
3 #
4 server.modules = ( 
5   "mod_access",
6   "mod_accesslog",
7   "mod_compress",
8   "mod_evasive",
9   "mod_fastcgi",
10   "mod_status"
11 )
12
13 #
14 # Basic server configuration
15 #
16 server.username = "www-data"
17 server.groupname = "www-data"
18 server.pid-file = "/var/run/lighttpd.pid"
19
20 #
21 # Setup logging
22 #
23 accesslog.filename = "/var/log/lighttpd/access.log"
24 server.errorlog = "/var/log/lighttpd/error.log"
25
26 #
27 # Allow munin to monitor the server's status
28 #
29 $HTTP["remoteip"] == "127.0.0.1" { status.status-url = "/server-status" }
30
31 #
32 # API 0.3 is long dead, so fail any attempt to access it without
33 # getting rails involved at all
34 #
35 $HTTP["url"] =~ "^/api/0.3/" { url.access-deny = ("") }
36
37 #
38 # IP blocked at SteveC's request as it was trying to download the
39 # history of every object in the database one at a time
40 #
41 $HTTP["remoteip"] == "143.210.16.160" { url.access-deny = ("") }
42
43 #
44 # Rule to block tilesAtHome when somebody decides to queue vast 
45 # number of tiles for rerendering
46 #
47 #$HTTP["useragent"] == "tilesAtHome" { url.access-deny = ("") }
48
49 #
50 # Limit connections to 20 per IP address
51 #
52 evasive.max-conns-per-ip = 20
53
54 #
55 # Setup MIME type mapping
56 #
57 mimetype.assign = (
58   ".css" => "text/css",
59   ".gif" => "image/gif",
60   ".html" => "text/html",
61   ".js" => "application/x-javascript",
62   ".png" => "image/png",
63   ".swf" => "application/x-shockwave-flash",
64   ".txt" => "text/plain"
65 )
66
67 #
68 # Enable compression of appropriate static content
69 #
70 compress.filetype = ( 
71   "application/x-javascript",
72   "application/x-shockwave-flash",
73   "text/css",
74   "text/html",
75   "text/plain"
76 )
77
78 #
79 # Cache compressed content
80 #
81 compress.cache-dir = "/var/cache/lighttpd"
82
83 #
84 # Serve static content from the rails public area ourselves
85 #
86 server.document-root = "/var/www/rails/public"
87
88 #
89 # Send everything else to the appropriate FastCGI server
90 #
91 server.error-handler-404 = "/dispatch.fcgi"
92 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
93
94 #
95 # Configure the FastCGI servers
96 #
97 fastcgi.server = ( 
98   ".fcgi" => (
99     ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
100     ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
101     ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
102     ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
103     ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
104     ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
105   ),
106   ".api" => (
107     ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
108     ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
109     ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )
110   )
111 )