Hi All, I'm completely new to Traefik and I'm coming over from Nginx Proxy Manager (NPM) which just "worked" for me. Right now, I'm having an issue where everything I serve returns a 404 error. To make my life simple, I've been creating the stacks within portainer and using it to create the labels. I currently have my own domain through cloudflare that I have CNAMEs set up for but when I start configuring a service (let's take bytestash for example):
Here's the compose file for traefik to set up the container:
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
# - 443:443/tcp # Uncomment if you want HTTP3
# - 443:443/udp # Uncomment if you want HTTP3
environment:
CF_DNS_API_TOKEN_FILE: /run/secrets/cf_api_token # note using _FILE for docker secrets
# CF_DNS_API_TOKEN: ${CF_DNS_API_TOKEN} # if using .env
TRAEFIK_DASHBOARD_CREDENTIALS: ${TRAEFIK_DASHBOARD_CREDENTIALS}
secrets:
- cf_api_token
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/jramos/docker/traefik/data/logs/traefik.log:/traefik.log
- /home/jramos/docker/traefik/data/traefik.yml:/traefik.yml:ro
- /home/jramos/docker/traefik/data/acme.json:/acme.json
- /home/jramos/docker/traefik/data/dynamic_config.yml:/dynamic_config.yml:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.rule=Host(`traefik-dashboard.mydomain.net`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_DASHBOARD_CREDENTIALS}"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=websecure"
- "traefik.http.routers.traefik-secure.rule=Host(`traefik-dashboard.mydomain.net`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=mydomain.net"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.mydomain.net"
- "traefik.http.routers.traefik-secure.service=api@internal
#SECRETS OMITED
networks:
proxy:
external: true
and here's my static config file:
api:
dashboard: true
debug: true
entryPoints:
web:
address: :80
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: ./dynamic_config.yml
certificatesResolvers:
cloudflare:
acme:
email: myemail@email.com
storage: acme.json
caServer: https://acme-v02.api.letsencrypt.org/directory # prod (default)
# caServer: https://acme-staging-v02.api.letsencrypt.org/directory # staging
dnsChallenge:
provider: cloudflare
#disablePropagationCheck: true # uncomment this if you have issues pulling certificates through cloudflare, By setting this flag to true disable>
#delayBeforeCheck: 60s # uncomment along with disablePropagationCheck if needed to ensure the TXT record is ready before verification is attempt>
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
log:
filePath: "./traefik.log"
format: json
level: DEBUG
maxBackups: 5
compress: true
as far as I can tell, all of this is OK, because when I pull up the dashboard, and check the container logs, I get no errors:
compose file for docker:
services:
bytestash:
image: "ghcr.io/jordan-dalby/bytestash:latest"
restart: always
volumes:
- /home/jramos/docker/bytestash/data:/data/snippets
ports:
- "5000:5000"
environment:
# See https://github.com/jordan-dalby/ByteStash/wiki/FAQ#environment-variables
BASE_PATH: ""
JWT_SECRET: #JWT SECRET
TOKEN_EXPIRY: 24h
ALLOW_NEW_ACCOUNTS: "true"
DEBUG: "true"
DISABLE_ACCOUNTS: "false"
DISABLE_INTERNAL_ACCOUNTS: "false"
# See https://github.com/jordan-dalby/ByteStash/wiki/Single-Sign%E2%80%90on-Setup for more info
OIDC_ENABLED: "false"
OIDC_DISPLAY_NAME: ""
OIDC_ISSUER_URL: ""
OIDC_CLIENT_ID: ""
OIDC_CLIENT_SECRET: ""
OIDC_SCOPES: ""
I have the following labels configured (through portainer)
traefik.http.routers.bytestash.rule=Host(`bytestash.domain.net`)
traefik.http.routers.bytestash.entrypoints=web
traefik.enable=true
everything looks like it's updated correctly
yet both http and https bring up 404 errors when browsing to the FQDN
I'm not sure what I'm missing, because even the traefik logs don't show any errors