# Requests with https lead to 404, traefik v2.10 and a simple docker-compose file

**URL:** <https://community.traefik.io/t/requests-with-https-lead-to-404-traefik-v2-10-and-a-simple-docker-compose-file/20499>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [November 18, 2023, 1:27pm UTC](https://community.traefik.io/t/requests-with-https-lead-to-404-traefik-v2-10-and-a-simple-docker-compose-file/20499 "2023-11-18T13:27:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sal](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sal](https://community.traefik.io/u/sal)\
**Post date:** [November 18, 2023, 1:27pm UTC](https://community.traefik.io/t/requests-with-https-lead-to-404-traefik-v2-10-and-a-simple-docker-compose-file/20499/1 "2023-11-18T13:27:33Z")

</div>

Hello everybody.

I'm trying to get https requests to route to a docker container.  
I have a very simple docker-compose file with the following configuration. No other config file.

```auto
version: "3"

services:
  reverse-proxy:
    image: traefik:v2.10
    command:
      --api.insecure=true
      --api.dashboard=true
      --api.debug=true
      --providers.docker
      --entryPoints.web.address=:80
      --entryPoints.websecure.address=:443
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - traefik
  whoami:
    image: traefik/whoami
    labels:
      - "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
      - "traefik.http.routers.whoami.entrypoints=websecure"
      - "traefik.http.routers.whoami.tls=true"
    networks:
      - traefik

  api:
    build: # ...
    labels:
      - "traefik.http.routers.api.rule=Host(`api.localhost`)"
      - "traefik.http.routers.api.entrypoints=websecure"
      - "traefik.http.routers.api.tls=true"
    networks:
      - traefik

networks:
  traefik:
    name: traefikExt
    driver: bridge

```

Calling the _api_ with http requests returns an OK response, but https returns 404.

Curl with http:

```auto
$ curl -H Host:api.localhost http://127.0.0.1
API IS LIVE

```

Curl with https:

```auto
$ curl --insecure -H Host:api.localhost https://127.0.0.1
404 page not found

```

Curiously, the whoami service does work with https, even though they seem to have the exact same tags in the docker-compose file.

```auto
$ curl --insecure -H Host:whoami.docker.localhost https://127.0.0.1
Hostname: 079b95fbd67f
...

```

On the contrary, whoami actually returns 404 when queried with http.

Could you help me understand why this happens and how could I get https routing correctly to my service? I'm very new to traefik and there are some very similar topics already, but probably none with quite as simple of a case as mine, so sorry if I'm missing something very obvious.

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [November 18, 2023, 4:57pm UTC](https://community.traefik.io/t/requests-with-https-lead-to-404-traefik-v2-10-and-a-simple-docker-compose-file/20499/2 "2023-11-18T16:57:07Z")

</div>

You enable TLS on router, but have no certs loaded nor a certresolver declared.

I recommend to declare TLS globally on https `entrypoint` and then use either a `certresolver` or load certs in a dynamic config file.

Maybe compare with [simple Traefik example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-traefik-dashboard-letsencrypt).

---

<div class="post-metadata">

**Author:** ![sal](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@sal](https://community.traefik.io/u/sal)\
**Post date:** [November 18, 2023, 5:53pm UTC](https://community.traefik.io/t/requests-with-https-lead-to-404-traefik-v2-10-and-a-simple-docker-compose-file/20499/3 "2023-11-18T17:53:41Z")

</div>

Thank you,  
No longer getting 404 after mounting a local directory to a volume at /letsencrypt and adding the lines:

```auto
      - "--entrypoints.websecure.http.tls.certresolver=myresolver"
      - "--certificatesresolvers.myresolver.acme.email=my@email.com"
      - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
      - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [November 21, 2023, 5:54pm UTC](https://community.traefik.io/t/requests-with-https-lead-to-404-traefik-v2-10-and-a-simple-docker-compose-file/20499/4 "2023-11-21T17:54:35Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
