TracNav menu
-
Core Features
- Configuration File Syntax
- Configuration Options
- Change Root
- Performance
- PerformanceFastCGI
- SSL
- Traffic Shaping
- Using SMP
-
Modules
- mod_accesslog
- mod_access
- mod_alias
- mod_auth
- mod_cache
- mod_cgi
- mod_cml
- mod_compress
- mod_deflate
- mod_dirlisting
- mod_evasive
- mod_evhost
- mod_expire
- mod_extforward
- mod_fastcgi
- mod_flv_streaming
- mod_geoip
- mod_magnet
- mod_mem_cache
- mod_mysql_vhost
- mod_proxy
- mod_redirect
- mod_rewrite
- mod_rrdtool
- mod_scgi
- mod_secdownload
- mod_setenv
- mod_simple_vhost
- mod_ssi
- mod_status
- mod_trigger_b4_dl
- mod_userdir
- mod_useronline
- mod_usertrack
- mod_webdav
-
Modules (1.5 only)
- mod_proxy_core
- mod_sql_vhost_core
- mod_uploadprogress
- mod_deflate
-
Internals
- FastCGI state-engine
- Plugin interface
- HTTP state-engine
-
Additional
- User written Modules
the Proxy Interface
Module: mod_proxy
Description
...
Options
lighttpd provides the Proxy support via the proxy-module (mod_proxy) which provides 3 options in the config-file:
| proxy.debug: | a value between 0 and 65535 to set the debug-level in the Proxy module. Currently only 0 and 1 are used. Use 1 to enable some debug output, 0 to disable it.Note:Use 'enable|disable' in v1.4.13. |
||||||
|---|---|---|---|---|---|---|---|
| proxy.balance: | might be one of 'hash', 'round-robin' or 'fair' (default). 'round-robin' chooses another host for each request, 'hash' is generating a hash over the request-uri and makes sure that the same request URI is sent to always the same host. That can increase the performance of the backend servers a lot due to higher cache-locality. 'fair' is the normal load-based, passive balancing. |
||||||
| proxy.server: | tell the module where to send Proxy requests to. Every file-extension can have its own handler. Load-Balancing is done by specifying multiple handles for the same extension. structure of proxy.server section:
( <extension> =>
(
( "host" => <string> ,
"port" => <integer> ),
( "host" => <string> ,
"port" => <integer> )
),
<extension> => ...
)
e.g.:
proxy.server = ( ".jsp" =>
( (
"host" => "10.0.0.242",
"port" => 81
) )
)
|
Example:
Using lighttpd + mod_proxy 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.balance = "hash"
proxy.server = ( "" => ( ( "host" => "10.0.0.10" ),
( "host" => "10.0.0.11" ),
( "host" => "10.0.0.12" ),
( "host" => "10.0.0.13" ),
( "host" => "10.0.0.14" ),
( "host" => "10.0.0.15" ),
( "host" => "10.0.0.16" ),
( "host" => "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'.
Troubleshooting
If you are getting:
2007-05-02 09:45:48: (mod_proxy.c.397) connect failed: 8 Network is unreachable 101 2007-05-02 09:45:48: (mod_proxy.c.871) proxy-server disabled: blabla.com 80 8 2007-05-02 09:45:48: (mod_proxy.c.1229) no proxy-handler found for: /
Check if you have used an IP address for the proxy address. Hostnames are not allowed there!

