Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Last active September 20, 2018 09:30
Show Gist options
  • Save omarqureshi/700b76a5ac4ba158dc72b42a11147f7c to your computer and use it in GitHub Desktop.
Save omarqureshi/700b76a5ac4ba158dc72b42a11147f7c to your computer and use it in GitHub Desktop.
version: '3'
services:
haproxy:
image: haproxy:1.5
volumes:
- /path/to/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
ports:
- "80:80"
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 50000
timeout client 100000
timeout server 100000
frontend http-in
bind 0.0.0.0:80
mode http
default_backend pheme_backends
acl host_pheme hdr(host) -i pheme
acl host_gatekeeper hdr(host) -i gatekeeper
use_backend pheme_backends if host_pheme
use_backend gatekeeper_backends if host_gatekeeper
backend pheme_backends
mode http
option forwardfor
balance roundrobin
server pheme pheme:80
backend gatekeeper_backends
mode http
option forwardfor
balance roundrobin
server gatekeeper gatekeeper:80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment