Skip to content

tinganho/haproxy-with-letsencrypt-auto-renewal

Repository files navigation

HAProxy with Letsencrypt Auto Renewal

This container contains an HAProxy server with an auto Letsencrypt renewal service.

Prerequisites

  • Docker Compose

Installation

docker pull tinganho/haproxy-with-letsencrypt-auto-renewal

Configurations

Create a HAProxy configuration file in /etc/haproxy/haproxy.cfg. And add at least the following entries:

global
    tune.ssl.default-dh-param 2048

frontend http
    bind *:80
    reqadd X-Forwarded-Proto:\ http
	acl letsencrypt-acl path_beg /.well-known/acme-challenge/
	redirect scheme https if !letsencrypt-acl
	default_backend letsencrypt-backend

frontend https
    bind *:443 ssl crt /usr/local/etc/haproxy/certs/domain.com.pem

backend letsencrypt-backend
    server letsencrypt 127.0.0.1:54321

In your docker-compose.yml file add the following service:

haproxy:
  image: tinganho/haproxy-with-letsencrypt-auto-renewal
  ports:
    - 80:80
    - 443:443
  environment:
    # Comma separated list of domains. The root domain must be the first entry.
    DOMAINS: domain.com, sub.domain.com
    EMAIL: user@domain.com
  volumes:
    - /etc/haproxy:/usr/local/etc/haproxy
    - /var/log/haproxy:/var/log/haproxy

About

HAProxy with letsencrypt auto renewal

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages