From dd72fea9533d67cc15bc335a8e07a0581d969c91 Mon Sep 17 00:00:00 2001 From: AEtherC0r3 Date: Tue, 30 Aug 2016 16:22:55 +0300 Subject: [PATCH] Add haproxy configuration file --- haproxy.cfg | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 haproxy.cfg diff --git a/haproxy.cfg b/haproxy.cfg new file mode 100644 index 0000000..18cb53e --- /dev/null +++ b/haproxy.cfg @@ -0,0 +1,40 @@ +resolvers docker_dns + nameserver dnsmasq 127.0.0.1:53 + +frontend ft_http + bind *:80 + bind :::80 + mode http + default_backend bk_http + +frontend ft_https + bind *:443 + bind :::443 + mode tcp + default_backend bk_https + +backend bk_http + mode http + + acl website hdr(host) -i techministry.rocks + acl website hdr(host) -i www.techministry.rocks + acl discourse hdr(host) -i discourse.techministry.rocks + + use-server website_server if website + use-server discourse_server if discourse + + server website_server website:80 resolvers docker_dns + server discourse_server discourse:80 resolvers docker_dns + +backend bk_https + mode tcp + + acl website req_ssl_sni -i techministry.rocks + acl website req_ssl_sni -i www.techministry.rocks + acl discourse req_ssl_sni -i discourse.techministry.rocks + + use-server website_server if website + use-server discourse_server if discourse + + server website_server website:443 resolvers docker_dns + server discourse_server discourse:443 resolvers docker_dns