Created
October 26, 2023 15:16
-
-
Save kkroesch/7a0c9de3b63451a9e44280db5255b02b to your computer and use it in GitHub Desktop.
HAProxy Certbot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOMAIN=$1 | |
certbot certonly \ | |
--standalone -d "$DOMAIN" \ | |
--email "helpdesk@$DOMAIN" | |
--non-interactive \ | |
--agree-tos \ | |
--http-01-port=8899 | |
cp /etc/live/$DOMAIN/fullchain.pem /etc/haproxy/${DOMAIN}.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------------------------------------------------------------------- | |
# main frontend which proxys to the backends | |
#--------------------------------------------------------------------- | |
frontend ssl | |
bind *:443 ssl crt /etc/haproxy/lab.kroesch.net.pem no-sslv3 | |
mode tcp | |
option tcplog | |
tcp-request inspect-delay 5s | |
tcp-request content accept if HTTP | |
acl letsencrypt-acl path_beg /.well-known/acme-challenge/ | |
use_backend letsencrypt-backend if letsencrypt-acl | |
use_backend secure_http if HTTP | |
#--------------------------------------------------------------------- | |
# Certbot backend | |
#--------------------------------------------------------------------- | |
backend letsencrypt-backend | |
server certbot 127.0.0.1:8899 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment