Skip to content

Instantly share code, notes, and snippets.

@quangtt-rks
Created April 5, 2017 08:34
Show Gist options
  • Save quangtt-rks/3131cb8e5094b3a00e6e244ded506074 to your computer and use it in GitHub Desktop.
Save quangtt-rks/3131cb8e5094b3a00e6e244ded506074 to your computer and use it in GitHub Desktop.
Sample config for load balancer on localhost
Listen 8080
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
ServerName 192.168.xxx.xxx
ProxyRequests Off
<Proxy balancer://mycluster>
BalancerMember http://192.168.xxx.yyy:8080 route=lb1
BalancerMember http://192.168.xxx.zzz:8080 route=lb2
ProxySet lbmethod=byrequests
</Proxy>
ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/
<Location /balancer-manager>
SetHandler balancer-manager
Order deny,allow
Allow from all
</Location>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment