- Most Recent |
24 hours |
7 days |
30 days |
365 days |
HowFlow —
This trick shows how to configure Lighttpd to deliver static content directly and proxy the requests to dynamic content to Mongrel, Thin or whatever.
Posted by
Hoodow 7 months ago
Hoodow 7 months ago
$HTTP["host"] == "your.host.com" {
var.appdir = "/path/to/your/app/"
accesslog.filename = "/var/log/lighttpd/yourapp.log"
dir-listing.activate = "disable"
$HTTP["url"] =~ "^/(images|stylesheets|javascripts)/(.*)$" {
server.document-root = appdir + "public/"
$HTTP["url"] =~ "^/(images|stylesheets|javascripts)/" {
# feel free to add stuff like
# expire.url = ( "" => "access 3 days" )
# or
# deflate.enabled = "enable"
# here
}
}
else $HTTP["host"] == "your.host.com" {
proxy-core.protocol = "http"
proxy-core.balancer = "sqf"
proxy-core.backends = ( "unix:/var/tmp/yourapp.0.sock",
"unix:/var/tmp/yourapp.1.sock",
"unix:/var/tmp/yourapp.2.sock",
"unix:/var/tmp/yourapp.3.sock",
"unix:/var/tmp/yourapp.4.sock" )
}
}
Please log in or sign up and vote for this trick if it was helpful for you.
Don't forget to subscribe to our
RSS/Atom feed to get the latest tricks.
Don't forget to subscribe to our
RSS/Atom feed to get the latest tricks.









