/ Published in: Other
How to send load-balanced requests to a web cluster and split the requests to different server pools based on specific ACL rules.
This configuration sends files ending with .php to a pool of "dynamic" web servers (running Apache).
It sends all other files (.js, .jpg, .css, .html) to a pool of "static" web servers (running Lighttpd).
This configuration sends files ending with .php to a pool of "dynamic" web servers (running Apache).
It sends all other files (.js, .jpg, .css, .html) to a pool of "static" web servers (running Lighttpd).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# HTTP web cluster frontend cluster_http bind :80 mode http option forwardfor acl content_php path_end .php use_backend dynamic_cluster_http if content_php default_backend static_cluster_http # Static cluster serving every file EXCEPT those ending with .php backend static_cluster_http mode http option forwardfor balance source option httpclose option httpchk HEAD / HTTP/1.0 server staticweb1 192.168.0.100:80 weight 1 check inter 1000 rise 5 fall 1 server staticweb2 192.168.0.101:80 weight 1 check inter 1000 rise 5 fall 1 # Dynamic cluster serving files ending with .php backend dynamic_cluster_http mode http option forwardfor balance source option httpclose option httpchk HEAD / HTTP/1.0 server dynweb1 192.168.0.102:80 weight 1 check inter 1000 rise 5 fall 1 server dynweb2 192.168.0.103:80 weight 1 check inter 1000 rise 5 fall 1