From d8df67fba0f188039b4cc273788d73b1df7aae59 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Wed, 8 Sep 2021 22:13:16 +0430 Subject: update --- terminaldweller.com/haproxy/docker-compose.yaml | 5 +++- terminaldweller.com/haproxy/haproxy.cfg | 32 ++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) (limited to 'terminaldweller.com/haproxy') diff --git a/terminaldweller.com/haproxy/docker-compose.yaml b/terminaldweller.com/haproxy/docker-compose.yaml index fe861d0..95752c8 100644 --- a/terminaldweller.com/haproxy/docker-compose.yaml +++ b/terminaldweller.com/haproxy/docker-compose.yaml @@ -6,4 +6,7 @@ services: - "80:80" volumes: - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro - + networks: + - haproxynet +networks: + - haproxynet diff --git a/terminaldweller.com/haproxy/haproxy.cfg b/terminaldweller.com/haproxy/haproxy.cfg index 39a42d2..19e7bac 100644 --- a/terminaldweller.com/haproxy/haproxy.cfg +++ b/terminaldweller.com/haproxy/haproxy.cfg @@ -1,23 +1,36 @@ global log 127.0.0.1 local0 - + defaults timeout connect 5000ms timeout client 50000ms timeout server 50000ms -mode http +mode tcp +option tcplog +option dontlognull -frontend http +#Frontends +frontend front bind *:80 +bind: *.443 +mode tcp +timeout client 60s + +#ACLs acl blog-host hdr_sub(host) -i blog.terminaldweller.com acl mail-host hdr_sub(host) -i mail.terminaldweller.com acl api-host hdr_sub(host) -i api.terminaldweller.com +acl chat-host hdr_sub(host) -i chat.terminaldweller.com +acl chat-host-s req.ssl_sni -i chat.terminaldweller.com +#Consitions use_backend blog-backend if blog-host use_backend mail-backend if mail-host use_backend api-backend if api-host +use_backend chat-backend-s if chat-host-s default_backend blog-backend +#Backends backend blog-backend mode http option forwardfor @@ -32,3 +45,16 @@ backend api-backend mode http option forwardfor server api-host 192.99.102.52:8008 check + +backend chat-backend +mode http +option forwardfor +server chat-host 87.236.209.206:5280 check + +backend chat-backend-s +timeout server 60s +timeout client 60s +mode tcp +option forwardfor +option ssl-hello-chk +server chat-host 87.236.209.206:5281 check -- cgit v1.2.3