Docs ModProxyCore » History » Revision 4
Revision 3 (jakabosky, 2006-12-12 22:53) → Revision 4/51 (jakabosky, 2006-12-12 23:01)
{{{ #!rst =================== the Proxy Interface =================== ---------------------- Module: mod_proxy_core ---------------------- .. contents:: Table of Contents Description =========== ... Options ======= lighttpd provides the Proxy support via the proxy-module (mod_proxy_core) which provides the following options in the config-file: :proxy-core.balancer: might be one of 'round-robin', 'sqf' or 'carp'. :proxy-core.protocol: might be one of 'http', 'fastcgi' or 'scgi'. Make sure you load the backend modules (see mod_proxy_backend_http/mod_proxy_backend_fastcgi/mod_proxy_backend_scgi) :proxy-core.backends: tell the module where to send Proxy requests to. It is a list of hostname/ip address/unix-domain socket :proxy-core.max-pool-size max size for pool of connections to backends. :proxy-core.check-local enable checking for url file in local document-root. Enable this for php :proxy-core.allow-x-sendfile enables use of "X-Sendfile/X-LIGHTTPD-Sendfile/X-LIGHTTPD-send-tempfile" :proxy-core.allow-x-rewrite :proxy-core.rewrite-request rewrite request headers or request uri. :proxy-core.rewrite-response rewrite response headers. Example: ======== Using lighttpd + mod_proxy_core in front of 8 Squids which handle the caching of dynamic content for you. All requests for the host www.example.org should be forwarded to the proxy. All proxies listen on port 80 for requests. :: $HTTP["host"] == "www.example.org" { proxy-core.protocol = "http" proxy-core.balancer = "sqf" proxy-core.rewrite-request = ( "Host" => ( ".*" => "www.example.org" ) ) proxy-core.backends = ( "10.0.0.10", "10.0.0.11", "10.0.0.12", "10.0.0.13", "10.0.0.14", "10.0.0.15", "10.0.0.16", "10.0.0.17" ) } If one of the hosts goes down the all requests for this one server are moved equally to the other servers. If you want to know more about the algorithm used here google for 'Microsoft CARP'. for php :: $HTTP["url"] =~ "\.php$" { proxy-core.balancer = "round-robin" proxy-core.protocol = "fastcgi" proxy-core.check-local = "enable" proxy-core.allow-x-sendfile = "enable" proxy-core.backends = ( "127.0.0.1:1026" ) proxy-core.max-pool-size = 16 } }}}