Skip to content

Instantly share code, notes, and snippets.

@michaeljs1990
Created September 17, 2015 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeljs1990/d9e066b9d019bd25dc4f to your computer and use it in GitHub Desktop.
Save michaeljs1990/d9e066b9d019bd25dc4f to your computer and use it in GitHub Desktop.
FROM haproxy:1.5
ENV PAYMENTS_URL test.com
COPY src/haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
CMD sh -c "haproxy -f /usr/local/etc/haproxy/haproxy.cfg"
global
stats socket /tmp/haproxy.sock mode 600 level admin
defaults
mode http
stats enable
stats uri /haproxy_stats
stats realm HAProxy\ Statistics
stats auth username:password
stats refresh 5s
frontend http-proxy
bind *:80
acl pay hdr(host) -i ${PAYMENTS_URL}
use_backend payments if pay
backend payments
balance roundrobin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment