By krishna404
Recently setup a server & using haproxy. Everything else runs smoothly but port 80 is not connecting. Here is the haproxy config file. Esp gives problem when certbot tries to renew. what am I missing here?
frontend backend.sample.com
bind *:80
# Test URI to see if its a letsencrypt request
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
use_backend letsencrypt-backend if letsencrypt-acl
bind 64.123.456.124:6684 ssl crt /etc/haproxy/certs/backend.sample.com.pem
default_backend webapps
backend webapps
balance roundrobin
server app01 64.123.456.124:5684
backend letsencrypt-backend
server letsencrypt 127.0.0.1:54321
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @krishna404,
I’ve had similar issues with certbot and HaProxy. I think due to the Haproxy certbot can’ decide if your SSL is for renewal or not.
The first hurdle to get around arises because LetsEncrypt authorizes a certificate for a server by requesting a file via an HTTP(S) request. However, HAProxy is not a web server. It won’t serve files by itself - it will only redirect a request to another location. Your application servers won’t be able to handle this authorization request.
As such, what you might need is to create a small script that checks for you if your SSL needs to be renewed and then installs a new Let’s Encrypt certificate.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.