Setup https using letsencrypt

Using letsecrypt docker and nginx to setup https (ssl offloading)


For tenbruggencatedevelopment.nl i needed a (free) ssl certificate. The project is running on docker.
I added a letencrypt container to fetch the certificate, this get shared with nginx in a volume. The domain config in nginx needs a small update, all traffic is redirected to port 443


Docker-compose example
#
# Docker Compose V2
#
version: "3"

services:
  nginx:
    build: nginx/
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./data/nginx:/etc/nginx/conf.d
      - ./data/certbot/conf:/etc/letsencrypt
      - ./data/certbot/www:/var/www/certbot


  certbot:
    image: certbot/certbot
    volumes:
      - ./data/certbot/conf:/etc/letsencrypt
      - ./data/certbot/www:/var/www/certbot

why-guy add:

Last Tweets: