tcp:
routers:
mysql-router:
rule: "HostSNI(`mysql.db.sample.io`)"
service: mysql-service
entryPoints:
- tcp
tls:
certResolver: myresolver
domains:
- main: "mysql.db.sample.io"
passthrough: true
services:
mysql-service:
loadBalancer:
servers:
- address: "myIP:myPort"
version: "3.7"
services:
traefik:
image: traefik:v2.9
container_name: traefik
command:
- "--api.insecure=true"
- "--entrypoints.tcp.address=:myPort"
- "--providers.docker=true"
- "--log.level=DEBUG"
- "--providers.file.filename=/etc/traefik/dynamic.yaml"
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=cloudflare"
- "--certificatesresolvers.myresolver.acme.email=hello@brimble.app"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "myPort:myPort"
- "8991:8080"
environment:
- CF_API_EMAIL=email
- CF_API_KEY=api-key
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik/dynamic.yaml:/etc/traefik/dynamic.yaml"
- "./letsencrypt:/letsencrypt"
networks:
- traefik_proxy
networks:
traefik_proxy:
external: true
I am making a reverse proxy to a database instance on a different server, when i use the wildcard (*) for my SNI, i can connect to the database instance i reversed proxy to using any domain i add there, i have also configure *.db configured on my cloudflare DNS record. My major problem is that, i can't connect to my database instead when i want to use my SNI domain, for certResolver, i am using cloudflare to as my cert resolver too