On HTTPS returns "404 page not found" (traefik:v1.7.14)

I'm trying to create a traefik container according to the documentation. Here are mine:
1)docker-compose.traefik.

---
version: "3.6"

networks:
  default:
    name: nginx-proxy
    external: true

services:
  traefik:
    image: "traefik:v1.7.14"
    container_name: ${COMPOSE_PROJECT_NAME}.traefik
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
    expose:
      # traefik dashboard port
      - 8080
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.entrypoints=https"
      - "traefik.http.routers.traefik.rule=Host(`docker.mysite`)"
      - "traefik.http.routers.traefik.tls=true"
      - "traefik.http.routers.traefik.tls.certresolver=cloudflare"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.services.traefik-traefik.loadbalancer.server.port=888"
      - "traefik.port=8080"

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./docker/traefik/traefik.toml:/etc/traefik/traefik.toml
      - ./docker/traefik/
    environment:
        - CF_API_EMAIL=myapifemail
        - CF_API_KEY=myapikey

2) For nginx labels

      - "traefik.enable=true"
      - "traefik.http.routers.traefik.entrypoints=https"
      - "traefik.http.routers.traefik.rule=Host(`docker.mysite`)"
      - "traefik.http.routers.traefik.tls=true"
      - "traefik.http.routers.traefik.tls.certresolver=cloudflare"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.services.traefik-traefik.loadbalancer.server.port=888"
      - "traefik.port=8080"

I also tried to fix it by this topic: HTTPS returns `404 page not found`
but unfortunately there is a different version of both the container and the image itself, I tried to change it, but this caused even more errors, so I returned everything as it was before

Hello @yellow_pus09,

I have an example of a working configuration of Traefik v1.7 (which is not supported anymore) here : make-my-server/docker-compose.traefik.yml at 7cc23de34be3f432413c5db8a3d9e2d6d576dd52 · tomMoulard/make-my-server · GitHub

With the corresponding nginx configuration : make-my-server/docker-compose.nginx.yml at 7cc23de34be3f432413c5db8a3d9e2d6d576dd52 · tomMoulard/make-my-server · GitHub

Hope it helps :slight_smile:

1 Like

Thanks! But it still returns some errors for example: Unable to obtain ACME certificate for domains:Host:traefik.${TRAEFIK_DOMAIN} But I solved it just delete 'traefik.'. Now I get msg="error parsing Authenticator user: ${USER}. I don’t even have any idea what user can be put in label ''traefik.frontend.auth.basic.users=${USER}''

Also, I tried to remove this label, but I'm not sure if this is correct. But now I'm getting another unrelated error: msg="Unable to obtain ACME certificate for domains \"https://mysite\" detected thanks to rule \"Host:https://mysite\" : unable to generate a certificate for the domains [https://mysite]: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rejectedIdentifier :: Error creating new order :: Cannot issue for \"https://docker.cheatmeal.pro\": Domain name contains an invalid character, url:
And even in browser I still get 404 page not found

This is for basicauth user authentication. You can remove it from labels.

This is due to traefik failing to issue TLS certificates. You can solve this by removing TLS, or by fixing it. To fix it, it seems that you did not set the SITE environment variable.

1 Like

Sorry, I incorrectly placed links to my site, now, when I try to run docker-compose up, neither error nor success appears, just as when I try to connect through the browser, 404 page not found appears And nothing else. Sorry if I make silly mistakes, I had no experience in traefik at all