Add the lighttpd configuration to subversion.
[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 # Limit connections to 20 per IP address
45 #
46 evasive.max-conns-per-ip = 20
47
48 #
49 # Setup MIME type mapping
50 #
51 mimetype.assign = (
52   ".css" => "text/css",
53   ".gif" => "image/gif",
54   ".html" => "text/html",
55   ".js" => "application/x-javascript",
56   ".png" => "image/png",
57   ".swf" => "application/x-shockwave-flash",
58   ".txt" => "text/plain"
59 )
60
61 #
62 # Serve static content from the rails public area ourselves
63 #
64 server.document-root = "/var/www/rails/public"
65
66 #
67 # Send everything else to the appropriate FastCGI server
68 #
69 server.error-handler-404 = "/dispatch.fcgi"
70 $HTTP["url"] =~ "^/api/" { server.error-handler-404 = "/dispatch.api" }
71
72 #
73 # Configure the FastCGI servers
74 #
75 fastcgi.server = ( 
76   ".fcgi" => (
77     ( "host" => "127.0.0.1", "port" => 8000, "check-local" => "disable" ),
78     ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable" ),
79     ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable" ),
80     ( "host" => "127.0.0.1", "port" => 8003, "check-local" => "disable" ),
81     ( "host" => "127.0.0.1", "port" => 8004, "check-local" => "disable" ),
82     ( "host" => "127.0.0.1", "port" => 8005, "check-local" => "disable" )
83   ),
84   ".api" => (
85     ( "host" => "127.0.0.1", "port" => 8006, "check-local" => "disable" ),
86     ( "host" => "127.0.0.1", "port" => 8007, "check-local" => "disable" ),
87     ( "host" => "127.0.0.1", "port" => 8008, "check-local" => "disable" )
88   )
89 )