Lighttpd Configuration Independent of Hostname or IP

Hopefully someone can help with a bit of lighttpd configuration for
my production rails app in Mac OS X.

I have an application which will be accessed by many different
domains and IP addresses. Examples:
http://crm.local/
http://localhost/
http://192.168.0.49/
http://65.256.120.90/ (fake, but you get the idea, an external
Internet facing IP address)
http://crm.mydomain.net/

My current config below only seems to work with “http://crm.local/
and I think it may be because of this line:
$HTTP[“host”] =~ “(www.)?crm.(local|mydomain.net)” {
which to me would match “http://crm.local/”, “http://www.crm.local/”,
http://crm.mydomain.net/” or “http://www.crm.mydomain.net/

Is there a way to configure lighttpd independently from the hostname
(like ignore it altogether, so if it gets a request on port 80 it
just sends it to my rails app)? I can see the advantages for virtual
domains or subdomains pointing to different apps, etc. But I’m
planning on just having this one server serve one rails app but will
be accessed through a few different IPs and hostnames.

I can’t seem to find any examples on the Net and the lighttpd doco is
woeful.

Thanks,
Dan

PS, My current lighttpd.conf (the parts that matter):

server.document-root = “/Users/CRMServer/var/www/kc/public”
server.bind = “crm.local”
server.port = 80
server.pid-file = “/Users/CRMServer/var/www/kc/log/
lighttpd.pid”
server.tag = “lighttpd_crm_doncaster”
server.username = “CRMServer”
server.groupname = “CRMServer”
accesslog.filename = “/Users/CRMServer/var/www/kc/log/
lighttpd.access.log”
server.errorlog = “/Users/CRMServer/var/www/kc/log/
lighttpd.error.log”
server.indexfiles = ( “index.php”, “index.html”,
“index.htm”, “default.htm” )
url.access-deny = ( “~”, “.inc” )

$HTTP[“host”] =~ “(www.)?crm.(local|mydomain.net)” {
server.document-root = “/Users/CRMServer/var/www/kc/public/”
server.error-handler-404 = “/dispatch.fcgi”
fastcgi.server= (".fcgi" =>
(“mydomain.net” =>
(
“socket” => “/Users/CRMServer/var/www/kc/tmp/sockets/
lighttpd-fcgi.socket”,
“bin-path” => “/Users/CRMServer/var/www/kc/public/
dispatch.fcgi”,
“bin-environment” => (“RAILS_ENV” => “production” ),
“max-load-per-proc” => 4,
“min-procs” => 1,
“max-procs” => 2,
“idle-timeout” => 60
)
)
)
}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs