0

So lately I heard about people running apache and nginx together, nginx for static content and apache for dynamic. Can the same be done with lighttpd and apache?

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
teeiger
  • 3
  • 2

1 Answers1

1

Absolutely. lighttpd can act as a proxy to a different web server for content that it doesn't handle locally.

A simple configuration would look like this - say you want lighttpd to send every request in /webapp/ to a different service:

$HTTP["url"] =~ "^/webapp" {
    proxy.server = ( "" =>
        ( ( 
            "host" => "127.0.0.1",
            "port" => 8000
        ) )
    )
}

That configuration would send traffic to 127.0.0.1 (localhost - change that if it's running on a different system) on port 8000 - adjust that configuration to fit your needs. Keep in mind that if the services are running on the same system, you'll need to make sure to move Apache off of listening on 80, which is its default.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248