1=================== 2the Proxy Interface 3=================== 4 5----------------- 6Module: mod_proxy 7----------------- 8 9:Author: Jan Kneschke 10:Date: $Date: 2004/08/01 07:01:29 $ 11:Revision: $Revision: 1.1 $ 12 13:abstract: 14 The proxy module a simplest way to connect lighttpd to 15 java servers which have a HTTP-interface. 16 17.. meta:: 18 :keywords: lighttpd, Proxy 19 20.. contents:: Table of Contents 21 22Description 23=========== 24 25... 26 27Options 28======= 29 30lighttpd provides the Proxy support via the proxy-module 31(mod_proxy) which provides 2 options in the config-file: 32 33:proxy.debug: 34 a value between 0 and 65535 to set the debug-level in the 35 Proxy module. Currently only 0 and 1 are used. Use 1 to 36 enable some debug output, 0 to disable it. 37 38:proxy.balance: 39 might be one of 'hash', 'round-robin' or 'fair' (default). 40 41 'round-robin' choses another host for each request, 'hash' 42 is generating a hash over the request-uri and makes sure 43 that the same request URI is sent to always the same host. 44 That can increase the performance of the backend servers 45 a lot due to higher cache-locality. 'fair' is the normal 46 load-based, passive balancing. 47 48:proxy.server: 49 tell the module where to send Proxy requests to. Every 50 file-extension can have its own handler. Load-Balancing is 51 done by specifying multiple handles for the same extension. 52 53 structure of proxy.server section: :: 54 55 ( <extension> => 56 ( 57 ( "host" => <string> , 58 "port" => <integer> ), 59 ( "host" => <string> , 60 "port" => <integer> ) 61 ), 62 <extension> => ... 63 ) 64 65 :<extension>: is the file-extension or prefix (if started with "/") 66 might empty to match all requests 67 :"host": is ip of the proxy server 68 :"port": is tcp-port on the "host" used by the proxy 69 server (default: 80) 70 71 e.g.: :: 72 73 proxy.server = ( ".jsp" => 74 ( ( 75 "host" => "10.0.0.242", 76 "port" => 81 77 ) ) 78 ) 79 80Example: 81======== 82 83Using lighttpd + mod_proxy in front of 8 Squids which handle the 84caching of dynamic content for you. All requests for the host 85www.example.org should be forwarded to the proxy. All proxies 86listen on port 80 for requests. :: 87 88 $HTTP["host"] == "www.example.org" { 89 proxy.balance = "hash" 90 proxy.server = ( "" => ( ( "host" => "10.0.0.10" ), 91 ( "host" => "10.0.0.11" ), 92 ( "host" => "10.0.0.12" ), 93 ( "host" => "10.0.0.13" ), 94 ( "host" => "10.0.0.14" ), 95 ( "host" => "10.0.0.15" ), 96 ( "host" => "10.0.0.16" ), 97 ( "host" => "10.0.0.17" ) ) ) 98 } 99 100If one of the hosts goes down the all requests for this one server are 101moved equally to the other servers. If you want to know more about 102the algorithm used here google for 'Microsoft CARP'. 103 104 105