Skip to content

Instantly share code, notes, and snippets.

@ppeble
Created August 26, 2014 16:51
Show Gist options
  • Save ppeble/5623dc9aad55fcb797bc to your computer and use it in GitHub Desktop.
Save ppeble/5623dc9aad55fcb797bc to your computer and use it in GitHub Desktop.
HAProxy setup - ptrimble
frontend main-frontend
bind 0.0.0.0:80
mode http
# block if !goodguys
# block if heartbeat_req was_forwarded (disabled until we figure out heartbeats to dependant services)
acl goodguys src 127.0.0.0/8 192.168.0.0/16 10.0.0.0/8
acl heartbeat_req url_beg /heartbeat
acl local-dev-server.dev_host_acl hdr(host) -i 127.0.0.1
acl public-api.dev_host_acl hdr(host) -i public-api.dev
acl rbac.dev_host_acl hdr(host) -i rbac.dev
acl sso-admin.dev_host_acl hdr(host) -i sso-admin.dev
acl sso-api.dev_host_acl hdr(host) -i sso-api.dev
acl was_forwarded hdr_cnt(x-forwarded-for) gt 0
default_backend admin-backend
maxconn 20000
reqadd X-Forwarded-Port:80
use_backend local-dev-server if local-dev-server.dev_host_acl
use_backend public-api-backend if public-api.dev_host_acl
use_backend rbac-backend if rbac.dev_host_acl
use_backend sso-admin-backend if sso-admin.dev_host_acl
use_backend sso-api-backend if sso-api.dev_host_acl
backend admin-backend
stats uri /
backend rbac-backend
mode http
server rbac rbac.lxc:6711 check inter 10s rise 2 fall 3
backend sso-api-backend
mode http
server localhost 127.0.0.1:6721 check inter 10s rise 2 fall 3
backend sso-admin-backend
mode http
server sso sso.lxc:6702 check inter 10s rise 2 fall 3
backend public-api-backend
mode http
server localhost 127.0.0.1:6701 check inter 10s rise 2 fall 3
backend local-dev-server
mode http
server localhost 127.0.0.1:8084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment