mod_proxy_core commited to svn 5

Posted by jan Tue, 18 Jul 2006 10:06:00 GMT

mod_proxy_core just got commited to SVN and is now available to testers.

server.modules = ( ..., "mod_proxy_core", .. )

## works
$HTTP["url"] =~ "^/proxyme/" {
  proxy-core.balancer = "round-robin" 
  proxy-core.protocol = "http" 
  proxy-core.backends = ( "wikipedia.org" )

  ## to be done
  proxy-core.rewrite-response = (
    "Location" => ( 
      "^http://en.wikipedia.org/(.*)" => "http://127.0.0.1:1025/$1" ) )
  proxy-core.rewrite-request = (
    "URI" => (
      "^/proxyme(/.*)" => "$1" ) )
}

The above config forwards everything from /proxyme/ to wikipeedia.org. It resolves the domain wikipedia.org and is using one of the address to forward the request. As you already see there will be a request and response header rewriter for rewriting Location headers and URIs.

What works ?

  • Round-Robin Load-Balancing
  • Failover of a backend is down
  • HTTP proxying
  • HTTP/1.1
  • Keep-Alive

What is missing

  • FastCGI, SCGI and CGI backends
  • Header Rewriting

Show me the source, Luke

In the source-browsers you can also take a look at the code to see what is going on in there.

Trackbacks

Use the following link to trackback from your own site:
http://blog.lighttpd.net/articles/trackback/1775

Comments

Leave a response

  1. Ross Tue, 18 Jul 2006 13:34:51 GMT
    Will there be a way to send-to-proxy-unless-a-static-file-exists (think: rails page caching), or will we still need to lean on mod_cml?
  2. Ezra Zygmuntowicz Tue, 18 Jul 2006 16:17:03 GMT
    Very cool Jan! Thanks for your hard work on Lighty. I will be testiong this right away.
  3. Markus Peter Tue, 18 Jul 2006 17:30:26 GMT
    If the proxy module reads the HTTP expires header and has an own cache of configurable size, Rails and similar systems would only need to send proper expiry headers instead of the static file hack.
  4. Joe Thu, 20 Jul 2006 20:54:22 GMT
    Kudos Jan.
  5. jake Wed, 02 Aug 2006 15:49:24 GMT
    so does this mean I dont have to figure out a way to load balance with Apache?? If so, a big freaking thank you to the lighttpd staff :) --jake
Comments