I am using lighttpd and tomcat running behind. I want lighttpd to handle all static files like images / css. Here is my config :
$HTTP["host"] =~ "www.example.com" {
alias.url = ( "/images_deal/" => "/home/deal/projects/deal/images/" )
alias.url += ( "/statics_deal/" => "/home/deal/workspace2/dolo/statics/" )
proxy.server = ( "" =>
( "tomcat" =>
(
"host" => "127.0.0.1",
"port" => 8080,
"fix-redirects" => 1
)
)
)
}
server.modules = ( "mod_access", "mod_alias", "mod_redirect", "mod_rewrite",)
The probleme is that I can't acces images on url like http://www.example.com/images_deal/img.png
I write a new lighthttpd configuration that enables access to static files, but the problem now is that I can't access my tomcat context directly, I mean : rewrite all request www.example.com to www.example.com/dolo/ before passing it to tomcat (because tomcat has more than one context. New config
alias.url = (
"/images_deal" => "/home/deal/projects/deal/images/",
"/statics_deal/" => "/home/deal/workspace2/dolo/statics/",
)
$HTTP["url"] !~ "^(/statics_deal/|/images_deal/)" {
url.rewrite-once = ( "^/(.*)" => "/dolo/$1", )
proxy.server = ( "" =>
( "tomcat" =>
(
"host" => "127.0.0.1",
"port" => 8080,
"fix-redirects" => 1
)
)
)
}
}