aboutsummaryrefslogtreecommitdiffstats
path: root/terminaldweller.com/haproxy
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-07-02 04:57:01 +0000
committerterminaldweller <thabogre@gmail.com>2021-07-02 04:57:01 +0000
commit9e1780717f603e5aa01d68afe37841d0b84f271b (patch)
treec7bb6193cf4271202b7653ddd2b1cc37e503f46f /terminaldweller.com/haproxy
parentso many things (diff)
downloadscripts-9e1780717f603e5aa01d68afe37841d0b84f271b.tar.gz
scripts-9e1780717f603e5aa01d68afe37841d0b84f271b.zip
update
Diffstat (limited to 'terminaldweller.com/haproxy')
-rw-r--r--terminaldweller.com/haproxy/docker-compose.yaml9
-rw-r--r--terminaldweller.com/haproxy/haproxy.cfg34
2 files changed, 43 insertions, 0 deletions
diff --git a/terminaldweller.com/haproxy/docker-compose.yaml b/terminaldweller.com/haproxy/docker-compose.yaml
new file mode 100644
index 0000000..fe861d0
--- /dev/null
+++ b/terminaldweller.com/haproxy/docker-compose.yaml
@@ -0,0 +1,9 @@
+version: "3.4"
+services:
+ haproxy:
+ image: haproxy
+ ports:
+ - "80:80"
+ volumes:
+ - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
+
diff --git a/terminaldweller.com/haproxy/haproxy.cfg b/terminaldweller.com/haproxy/haproxy.cfg
new file mode 100644
index 0000000..39a42d2
--- /dev/null
+++ b/terminaldweller.com/haproxy/haproxy.cfg
@@ -0,0 +1,34 @@
+global
+log 127.0.0.1 local0
+
+defaults
+timeout connect 5000ms
+timeout client 50000ms
+timeout server 50000ms
+mode http
+
+frontend http
+bind *:80
+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
+
+use_backend blog-backend if blog-host
+use_backend mail-backend if mail-host
+use_backend api-backend if api-host
+default_backend blog-backend
+
+backend blog-backend
+mode http
+option forwardfor
+server blog-host 192.99.102.52:9000 check
+
+backend mail-backend
+mode http
+option forwardfor
+server mail-host 185.126.202.69:80 check
+
+backend api-backend
+mode http
+option forwardfor
+server api-host 192.99.102.52:8008 check