Skip to content

Commit 18c765e

Browse files
committed
HaProxy Certbots make certificate challange possible without stopping haproxy
1 parent dd0d5b8 commit 18c765e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packaging/aleph-vm/etc/haproxy/haproxy-aleph.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ frontend ft_http
7171
# Extract Host header and store it
7272
http-request set-var(txn.host) hdr(host)
7373

74+
# Redirect to letsencrypt certbot for certificate challange requests
75+
# Test URI to see if its a letsencrypt request
76+
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
77+
use_backend bk_letsencrypt if letsencrypt-acl
78+
7479
# Find the target server dynamically from Host header
7580
use_backend bk_http if { var(txn.host) -m found }
7681
default_backend bk_default_supervisor
@@ -116,6 +121,10 @@ backend bk_default_ssl
116121
mode tcp
117122
server fallback_local 127.0.0.1:4443 send-proxy
118123

124+
# Let's encrypt Backend for certificate renewal
125+
backend bk_letsencrypt
126+
server letsencrypt 127.0.0.1:8888
127+
119128
# Internal frontend that handles TLS termination (serve cert) and HTTP
120129
frontend ft_terminated_ssl
121130
bind 127.0.0.1:4443 ssl crt /etc/haproxy/certs/ accept-proxy

0 commit comments

Comments
 (0)