-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhaproxy.cfg
More file actions
41 lines (34 loc) · 1.41 KB
/
haproxy.cfg
File metadata and controls
41 lines (34 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Global configurations
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
tune.ssl.default-dh-param 2048 # required parameter for SSL bumping
# Default settings
defaults
log global
mode http # tcp can be used if you don't want to do SSL bumping
option httplog # tcplog can be used if you don't want to do SSL bumping
option dontlognull
timeout connect 5000
timeout client 10000
timeout server 10000
frontend https
bind *:80
# You can use either a single forlder or multiple crt definitions in this line (crt test.pem crt test2.pem)
bind *:443 ssl crt /etc/ssl/ alpn h2,http/1.1
redirect scheme https code 301 if !{ ssl_fc }
# Add one acl and use_backend per domain
acl host_whicheloe.us hdr(host) -i whicheloe.us
use_backend whicheloe.us if host_whicheloe.us
# The local variant might be useful for local dev using certs with your hosts pointing it at localhost
acl host_example.org hdr(host) -i local.example.org
use_backend example.org if host_example.org
# Back Ends
backend whicheloe.us
option forwardfor
server localhost localhost:3005 check # Linux Host
# server host.docker.internal host.docker.internal:3005 check # Mac/Windows Host
backend example.org
option forwardfor
server localhost localhost:3006 check # Linux Host
# server host.docker.internal host.docker.internal:3006 check # Mac/Windows Host