I want to reverse proxy an application which defaults to https with a self-signed certificate
Here is the docker compose i am using
traefik:
image: traefik:v3.0
container_name: traefik
restart: unless-stopped
command:
- --global.sendanonymoususage=false
- --api=true
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entrypoint.to=websecure
- --entrypoints.web.http.redirections.entrypoint.scheme=https
- --entrypoints.web.http.redirections.entrypoint.permanent=true
- --entrypoints.websecure.address=:443
- --entrypoints.websecure.asDefault=true
- --entrypoints.websecure.http.tls=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.filename=/traefik/config.toml
- --log.level=DEBUG
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/letsencrypt:/etc/letsencrypt
- /opt/containers/traefik:/traefik
labels:
- traefik.enable=true
- traefik.http.routers.traefik.rule=Host(`traefik.domain.com`)
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik.middlewares=authtraefik
- traefik.http.middlewares.authtraefik.basicauth.users=user:pass
app:
...
ports:
- 8080:8080
labels:
- traefik.enable=true
- traefik.http.routers.app.rule=Host(`app.domain.com`)
- traefik.http.services.app.loadbalancer.server.port=8080
- traefik.http.services.app.loadbalancer.serverstransport=ignorecert
- traefik.http.services.app.loadbalancer.server.scheme=https
/traefik/config.toml
just contains 2 things, the ssl certificate and a serversTransport for containers which use a self signed certificate
[[tls.certificates]]
certFile = '/etc/letsencrypt/live/{domain}/fullchain.pem'
keyFile = '/etc/letsencrypt/live/{domain}/privkey.pem'
[http.serversTransports.ignorecert]
insecureSkipVerify = true
It gives me the following error - ERR github.com/traefik/traefik/v3/pkg/server/router/router.go:136 > error="servers transport not found ignorecert@docker" entryPointName=websecure routerName=app@docker
.
Do note that i don't want to enable insecureSkipVerify
globally but only for couple of docker containers which use a self signed certificate.