Open Kellorn opened 1 year ago
What works for me. It redirects all HTTP traffic to HTTPS.
traefik.yml
## STATIC CONFIG (restart traefik to update)
# shows you a log msg if a newer image tag can be used
global:
checkNewVersion: true
# log default is ERROR, but WARN is more helpful
log:
level: WARN
# level: INFO
# enable dashboard on 8080 with auth
# api:
# insecure: true
# dashboard: true
# enable ping so the `traefik healthcheck` works
# ping: {}
providers:
docker:
# exposedByDefault: true
watch: true
file:
fileName: /traefik.yml
watch: true
# listen on 80/443, and redirect all 80 to 443 via 301
entryPoints:
web:
address: :80
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
tls:
certificates:
- certFile: /certs/localcert.pem
keyFile: /certs/localkey.pem
# when testing certs, enable this so traefik doesn't use
# it's own self signed. By default if it can't find a matching
# cert, it'll just create it's own which will cause cert warnings
# in browser
options:
default:
sniStrict: true
docker-compose.yml
nginx:
...
labels:
- "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)"
- traefik.http.routers.${PROJECT_NAME}_nginx.tls=true
...
traefik:
image: traefik
container_name: "${PROJECT_NAME}_traefik"
ports:
- "${PROJECT_PORT}:80"
- "${PROJECT_PORT_SECURE}:443"
- '8080:8080' # Dashboard
volumes:
- ./traefik.yml:/traefik.yml:ro
- /etc/ssl:/certs
- /var/run/docker.sock:/var/run/docker.sock:ro
Comments or improvements are welcome
Codebase Mounted codebase
Describe your issue I'm trying to install a Drupal 10 wodby stack with ssl certificates (using mkcert). I have a 404 when i'm trying to access to my project_base_url but there is a good ssl certificate How can we debug 404 page with docker in order to resolve this ? I'm on a M1 apple with docker.
Output of
docker info
Contents of your
docker-compose.yml
Contents of your
.env
Logs output
docker-compose logs
traefik.yml :
config.yml :