Hi all, I'm running into a problem that I can't seem to figure out and Google, Forums, ChatGPT & Claude AI have not been useless. I'm really hoping someone here can help.
I'm running traefik via docker on host "traefik1" which I'm using as a reverse proxy to serve an app running on an external server "canary1". I'm able to access the traefik dashboard but no matter what I do, I keep getting a 404 when trying to access the app.
Here is the docker-compose file
version: '3'
services:
traefik:
image: traefik:v3.1.2
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- traefik
ports:
- 80:80
- 443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik.yml:/etc/traefik/traefik.yml:ro
- ./config/config.yml:/etc/traefik/config.yml:ro
- ./data/acme.json:/etc/traefik/acme.json
labels:
- "traefik.enable=true"
# Route for Traefik dasboard
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.rule=Host(`traefik.example.net`)"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.tls.certresolver=letsencrypt"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=secureHeaders@file"
# Route for Canary Tokens applicaiton
- "traefik.http.routers.canary.entrypoints=websecure"
- "traefik.http.routers.canary.rule=Host(`canary.example.net`)"
- "traefik.http.routers.canary.tls=true"
- "traefik.http.routers.canary.tls.certresolver=letsencrypt"
- "traefik.http.services.canary.loadbalancer.server.url=http://192.1.1.1:8081"
- "traefik.http.routers.canary.service=canary"
- "traefik.http.routers.canary.middlewares=secureHeaders@file"
networks:
traefik:
external: true
Here is traefik.yml
global:
checkNewVersion: true
sendAnonymousUsage: false
api:
dashboard: true
insecure: true
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
certificatesResolvers:
letsencrypt:
acme:
email: info@example.net
storage: /etc/traefik/acme.json
httpChallenge:
entryPoint: web
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
network: traefik
file:
filename: "/etc/traefik/config.yml"
watch: true
log:
level: DEBUG
accessLog: {}
Here is my config.yml
http:
middlewares:
secureHeaders:
headers:
sslRedirect: true
forceSTSHeader: true
stsIncludeSubdomains: true
stsPreload: true
stsSeconds: 31536000
customFrameOptionsValue: "SAMEORIGIN"
contentTypeNosniff: true
browserXssFilter: true
referrerPolicy: "strict-origin-when-cross-origin"
permissionsPolicy: "camera=(), microphone=(), geolocation=(), payment=()"
customResponseHeaders:
X-Robots-Tag: "none,noarchive,nosnippet,notranslate,noimageindex"
services:
canary:
loadBalancer:
servers:
- url: "http://192.1.1.1:8081"
tls:
options:
default:
minVersion: VersionTLS13
cipherSuites:
- TLS_AES_128_GCM_SHA256
- TLS_AES_256_GCM_SHA384
- TLS_CHACHA20_POLY1305_SHA256
A couple things I noticed from the logs.
First, I keep seeing this line, which is odd because that IP is the internal IP of the docker container and not the external app I should be connecting to.
"GET / HTTP/2.0" 404 19 "-" "-" 1 "canary@docker" "http://172.20.0.2:80" 1ms
Secondly, I see this error in batches:
http: TLS handshake error from 172.169.206.159:39904: tls: client offered only unsupported versions: [303 302 301]
Any help with this would be greatly appreciated as I've been at this for days now.