proxy.txt 2.9 KB

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