Traefik and nginx 404 page not found

Hello,

defaultEntryPoints is missplaced: TOML is not indentation based.

logLevel = "DEBUG"
defaultEntryPoints = ["http", "https"] <---

[traefikLog]
  filePath = "/var/log/traefik/traefik.log"
  format   = "json"

[accessLog]
  filePath = "/var/log/traefik/access.log"
  format = "json"


[entryPoints]
  [entryPoints.dashboard]
    address = ":8080"
    [entryPoints.dashboard.auth]
      [entryPoints.dashboard.auth.basic]
        users = ["xxxxxx:xxxxxxxxxxxxxxxxxxx"]
  [entryPoints.http]
    address = ":80"
      [entryPoints.http.redirect]
        entryPoint = "https"
  [entryPoints.https]
    address = ":443"
      [entryPoints.https.tls]

[api]
entrypoint="dashboard"

[acme]
email = "info@xxxxx.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
  [acme.httpChallenge]
  entryPoint = "http"

[docker]
domain = "xxxxxxxxxxx.com"
watch = true
network = "traefik"

I recommend to update your Traefik from traefik:v1.7.6-alpine to traefik:v1.7.14-alpine.

Also you can remove some labels:

version: "3.3"

services:
  nginx:
    image: nginx:alpine
    user: root
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./html:/usr/share/nginx/html
      - ./conf.d/nginx.conf:/etc/nginx/nginx.conf
      - /var/log/nginx:/var/log/nginx
    networks:
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.backend=nginx"
      - "traefik.port=80"
      - "traefik.frontend.rule=Host:xxxx.xxxx.com"
    deploy:
      mode: replicated
      replicas: 2

networks:
  traefik:
    external: true
1 Like