- Lighttpd
- Andre Bogus
- 301字
- 2021-08-25 18:06:23
mod_proxy_core and backends
Since version 1.5.0, the dynamic page processing interface core functionality was consolidated into mod_proxy_core
and only the differences between the interfaces moved into a backend for each. This reduces duplication, with some obvious benefits. Less duplicated code implies less stuff in memory, less chances for errors, more testing for the core, and optimizations apply to all interfaces.
The syntax has changed a little, for example, we no longer assign path prefixes to configurations, but use selectors to reduce the reach of the backends.
Suppose that we want to use mod_proxy_core
, we add it to server_modules
along with the backends we want. Then we carve out a niche for each backend and configure the backends. For example, to use SCGI for a python application and FastCGI for PHP, we write:
server.modules = ( ..., "mod_proxy_core", "mod_proxy_backend_fastcgi", "mod_proxy_backend_scgi", # see appendix B for all backends. ... ) $HTTP["url"] =~ ".py" { # use SCGI for python files proxy_core.protocol = "scgi" proxy-core.balancer = "carp" # tries to keep processes together proxy-core.backends = { # we have 3 SCGI servers to balance: "127.0.0.1:3456", # a local port (by IP address) "otherhost.mydomain.net:3456", # a port on another host "unix:/tmp/python.socket" # a unix socket } proxy-core.max-pool-size = 3 # for SCGI the number of backends # for other options, see Appendix B } $HTTP["url"] =~ ".php" { # use FastCGI for PHP files proxy_core.protocol = "fastcgi" proxy-core.balancer = "sqf" # tries to balance workload fairly proxy-core.backends = { "unix:/tmp/php-fastcgi.socket", "[::1]:4001" # on IPv6 host 1 in this network, port 4001 } proxy-core.max-keep-alive-requests = 8 # analog to server.max-keep-alive-requests, see chapter 9 proxy-core.allow-x-sendfile = "enable" # see chapter 9 }
The use of selectors gives us greater freedom on when to use which backend, and the uniform syntax makes it easy to learn and use.
- Vue.js前端開發技術
- 創意UI:Photoshop玩轉移動UI設計
- 中文版3ds Max 2016/VRay效果圖制作實戰基礎教程
- 鍵盤錄入技術(第2版)
- UG NX 9.0中文版 基礎教程 (UG工程師成才之路)
- Photoshop CC 服裝設計經典實例教程
- SPSS統計分析
- 中文版Dreamweaver基礎培訓教程
- 高等院校電腦美術教材:CorelDRAW X7中文版基礎教程
- Photoshop CS6中文版基礎與實例教程(第6版)
- Adobe創意大學InDesign CS5 產品專家認證標準教材
- Adobe創意大學InDesign產品專家認證標準教材(CS6修訂版)
- 深入淺出WebAssembly
- 新編 中文版Photoshop平面設計入門與提高
- 中文版Photoshop CS6完全自學手冊(超值版)