My booring Blog

Mauro Frigerio blog

Multiple domains for the same container with Traefik

23-07-2022 1 min read Article

This example shows how you can configure several domains to access the same docker container by using Traefik. In this example I want to connect the domains whoami.example.com and whoami.traefik-examples.tk to the same docker container.

All necessary files are available on GitHub.

Requirements

  1. Two domain names that both point to the Traefik instance (in this example I use example.com and traefik-examples.tk)
  2. For both domains the SSL certificate is generated by Let’s Encrypt
  3. Traefik is already working (see basic example)

Steps

  1. Aggiungere o modificare il docker-compose dei container interessati
  whoami:
    image: containous/whoami
    container_name: whoami
    labels:
      - 'traefik.enable=true'
      - "traefik.http.routers.whoami.rule=Host(`whoami.example.com`) || Host(`whoami.traefik-examples.tk`)"  # <== edit
      - 'traefik.http.routers.whoami.entrypoints=web-secure'
      - 'traefik.http.routers.whoami.tls=true'
      - "traefik.http.routers.whoami.tls.certresolver=certificato"
      - "traefik.http.routers.whoami.tls.domains[0].main=*.example.com"
      - "traefik.http.routers.whoami.tls.domains[1].main=*.traefik-examples.tk" # <== add
  1. Recreate the whoami container with the command
sudo docker-compose up -d whoami
  1. In the browser try to reach the site using both addresses

If you discover problems in this guide or in the configuration files, you can open an issue on GitHub. Thank you!

Continue reading

Free domain for home projects

02-06-2022 2 min read Article

Uptime Kuma e ping su traefik

28-10-2021 2 min read Article

Intro

Quando la propria rete casalinga inizia a crescere è comodo controllare i vari servizi/test attivi sulla rete. Uptime Kuma permette di avere un container Docker all-inclusive che permette di sorvegliare con vari metodi (ping, http(s), DNS) un sistema e di inviare notifiche in caso di problemi.

Scopo

  • installare Uptime Kuma in docker
  • aggiungere la configurazione di traefik
  • verificare che traefik funzioni correttamente

Requisiti

I passaggi seguenti richiedono il funzionamento su un host di docker, docker-compose e trafik con https. Seguire questi passaggi per avere le informazioni necessarie.

Continue reading

Install Guacamole on Docker with Traefik and 2FA

13-07-2021 3 min read Article

Esempio mutual TLS con Traefik

10-04-2021 1 min read Article

Many configuration guides for SSH server suggest eliminating the login with a username/password and replace it with a key. More and more I use this solution in my small home environment. A day on Twitter I have seen this tweet and I have made some tests with mutual TLS (or mTLS).

I find mTLS really helpful when you cannot use a VPN, for example on an enterprise pc or due to some firewall restriction. So you can protect your services with a certificate installed in a browser. This solution works only for sites that should only accessible for a few users.

Continue reading

SSO and 2FA for Traefik and Docker containers

28-06-2020 2 min read Article

Traefik 2.x examples

09-06-2020 2 min read Article

TLTR

On GitHub you can find a repository with some examples of traefik (version 2.x) configuration. You find the docker-compose and the guide on how to use this.

Feel free to report the issue if something is not working.

Intro

I have no trouble saying that I am a bad developer (no problem is not my work). In my home network, I play with some systems. For 2-3 years I experiment with docker and my container number it’s growing every month. Sometimes it is only a test and the container lives for a few hours. But there is a group of services that are important for my home, like:

Continue reading
Newer posts