# \[Solved\] - Unable to reach container under https

**URL:** <https://community.traefik.io/t/solved-unable-to-reach-container-under-https/19941>\
**Category:** Traefik v3 (latest)\
**Tags:** docker\
**Created:** [September 23, 2023, 10:10pm UTC](https://community.traefik.io/t/solved-unable-to-reach-container-under-https/19941 "2023-09-23T22:10:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wako057](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/wako057/32/7616_2.png) [@wako057](https://community.traefik.io/u/wako057)\
**Post date:** [September 23, 2023, 10:10pm UTC](https://community.traefik.io/t/solved-unable-to-reach-container-under-https/19941/1 "2023-09-23T22:10:32Z")

</div>

Hello,

I'm trying to reach a whoami container under https on my local computer  
To do so I've added those line to `/etc/hosts`

```auto
127.0.0.1 dummy.org
127.0.0.1 traefik.dummy.org
127.0.0.1 api.dummy.org

```

As recommended by [lets encrypt](https://letsencrypt.org/docs/certificates-for-localhost/) I've used minica in order to generate a certificate

I've generated the certificate with `./minica --domains 'dummy.org,traefik.dummy.org,api.dummy.org`  
docker-compose.yml

```auto
services:
  traefik:
    image: traefik:v3.0
    ports:
      - "80:80"
      - "8080:8080"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik.yml:/etc/traefik/traefik.yml
      - ./conf.d/:/etc/traefik/conf.d/
      - ${PWD:-.}/certs/:/certs/

  whoami:
    image: "traefik/whoami"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.entrypoints=dummy,dummy_unsecure"
      - "traefik.http.routers.whoami.rule=Host(`api.dummy.org`)"

```

**traefik.yml**

```auto
## Static Configuration
log:
  level: DEBUG
  
# print access log
accessLog: {}

# enable dashboard on 8080 with auth
api:
# insecure: true
  dashboard: true

entryPoints:
  dummy_unsecure:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: dummy
          scheme: https
  dummy:
    address: ":443"
    asDefault: true
    http:
      tls:
        domains:
          - main: dummy.org
            sans:
              - api.dummy.org

providers:
  docker: {}
  file:
    directory: /etc/traefik/conf.d/
    watch: true

```

Here is the dynamic configuration I've written in the `conf.d` directory  
**dynamic-config.yml**

```auto
## Dynamic configuration

tls:
  certificates:
    - certFile: /certs/cert.pem
      keyFile: /certs/key.pem
      stores:
        - default

http:
  routers:
    dashboard:
      rule: Host(`traefik.dummy.org`)
      service: api@internal

```

I can access in https to [treafik.dummy.org](http://treafik.dummy.org)  
When I try to reach the [api.dummy.org](http://api.dummy.org) in http its working fine  
SOLVED - NOT ANYMORE: _When I try to reach the [api.dummy.org](http://api.dummy.org) in https I'm meeting a 404_

_Do you have a clue of what I'm missing?_

---

<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:** [September 24, 2023, 6:51am UTC](https://community.traefik.io/t/solved-unable-to-reach-container-under-https/19941/2 "2023-09-24T06:51:14Z")

</div>

`api` router does not have TLS enabled, neither globally on `entrypoint` nor on `router`. Check [simple Traefik example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-traefik-dashboard-letsencrypt).

---

<div class="post-metadata">

**Author:** ![wako057](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/wako057/32/7616_2.png) [@wako057](https://community.traefik.io/u/wako057)\
**Post date:** [September 24, 2023, 7:07pm UTC](https://community.traefik.io/t/solved-unable-to-reach-container-under-https/19941/3 "2023-09-24T19:07:45Z")

</div>

Thanks a lot for you answer, even if the example, already read, wasn't usefull, your explaination of setting up the TLS for the entrypoint help me to understand what was wrong

I've added an

- `entryPoints.dummy.http.tls.domains.main`
- `entryPoints.dummy.http.tls.domains.sans`

In my traefik configuration and I can reach the whoami container, I've given a try to the v3 version, I was a bit afraid of it due to the gap after the v1 -\> v2 changes and it worked like a charm, I've also added the `useDefault`

I'm modifying the originals post for the follow up  
If ever you have some remarks to improve the solution please let me know

---

<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:** [September 27, 2023, 7:08pm UTC](https://community.traefik.io/t/solved-unable-to-reach-container-under-https/19941/4 "2023-09-27T19:08:43Z")

</div>

Closed on September 27, 2023, 7:08pm UTC

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