Having trouble with a 404 page not found error with traefik / docker, getting it with hostname and ip address (local & public). A & CNAME records configured in Cloudflare (currently grey mode). Port forwarding on router to server for 8008 (http) and 8443 (https) because 80 & 443 are already taken on network by other server.
Confirmed with cn -vz x.x.x.x port
that ports are open and available:
Connection to 192.168.0.201 port 8443 [tcp/pcsync-https] succeeded!
Connection to 1.2.3.4 port 8443 [tcp/pcsync-https] succeeded!
Connection to traefik.domain.com port 8443 [tcp/pcsync-https] succeeded!
Not sure what I’m screwing up and where exactly, so hopefully my configs below will give more insights. Also adding pastebin for traefik.log here.
Hope someone can point me in the right direction? Thx!
docker-compose.yml
version: "3.9"
services:
traefik:
image: traefik:v2.10
container_name: traefik
restart: always
networks:
- proxy
ports:
- 8008:80
- 8443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- $DOCKERDIR/appdata/traefik/traefik.yml:/traefik.yml:ro
- $DOCKERDIR/appdata/traefik/configs:/configs:ro
- $DOCKERDIR/appdata/traefik/acme/acme.json:/acme.json:rw
- $DOCKERDIR/appdata/traefik/logs:/logs:rw
environment:
- CF_DNS_API_TOKEN=${CLOUDFLARE_DNS_API}
- TRAEFIKADMIN=${TRAEFIKADMIN}
read_only: true
security_opt:
- no-new-privileges=true
labels:
- traefik.enable=true
- traefik.http.routers.traefik-https.entrypoints=https
- traefik.http.routers.traefik-https.rule=Host(`traefik.domain.com`)
- traefik.http.middlewares.traefik-auth.basicauth.users={$TRAEFIKADMIN}
- traefik.http.routers.traefik-https.middlewares=traefik-auth
- traefik.http.routers.traefik-https.service=api@internal
- traefik.http.routers.traefik-https.tls.certresolver=letsencrypt
- traefik.http.routers.traefik-https.tls.domains[0].main=domain.com
- traefik.http.routers.traefik-https.tls.domains[0].sans=*.domain.com
networks:
proxy:
external: {}
traefik.yml
api:
dashboard: true
entryPoints:
http:
address: ":80"
forwardedHeaders:
trustedIPs:
- "127.0.0.1/32"
- "10.0.0.0/8"
- "192.168.0.0/16"
- "172.16.0.0/12"
https:
address: ":443"
http:
tls:
certResolver: letsencrypt
forwardedHeaders:
trustedIPs:
- "127.0.0.1/32"
- "10.0.0.0/8"
- "192.168.0.0/16"
- "172.16.0.0/12"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
defaultRule: "Host(`{{ index .Labels \"com.docker.compose.service\”}}.domain.com`)"
network: proxy
file:
directory: "/configs"
watch: true
certificatesResolvers:
http:
acme:
email: usr@domain.com
storage: acme.json
httpChallenge:
entryPoint: http
letsencrypt:
acme:
caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
email: usr@domain.com
storage: acme.json
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
serversTransport:
insecureSkipVerify: false
accessLog:
filePath: "/logs/access.log"
fields:
headers:
names:
User-Agent: keep
log:
filePath: "/logs/traefik.log"
level: DEBUG
middlewares.yml
http:
middlewares:
traefik-auth:
basicAuth:
users:
- “usr:password”
tsl.yml
tls:
options:
default:
minVersion: VersionTLS12
cipherSuites:
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
- "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"
- "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
- "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
- "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305"
.env
USERDIR="/home/usr”
DOCKERDIR="/home/usr/docker"
DATADIR="/mnt/storage"
#DOMAINNAME_CLOUD_SERVER=domain.com
#CLOUDFLARE_EMAIL=usr@domain.com
#CLOUDFLARE_API_KEY=@@@@@
CLOUDFLARE_DNS_API=@@@@@
#LOCAL_IPS=127.0.0.1/32,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12
#CLOUDFLARE_IPS=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.>
TRAEFIKADMIN=usr:@@@@@