Heziode / traefik-v2-https-ssl-localhost

A simple example on how to use Traefik on localhost with HTTPS
MIT License
215 stars 58 forks source link

Documentation for referencing `router` object? #3

Closed mangkoran closed 2 years ago

mangkoran commented 2 years ago

First of all, thank you for this simple-yet-clear Traefik template with HTTPS!

I have a question regarding these lines: https://github.com/Heziode/traefik-v2-https-ssl-localhost/blob/73fb3f31177d9055cf1e7e0832e615e3792c2fcf/docker-compose.yml#L28-L29

From what I understand, the lines will reference to traefik router object configuration declared in the dynamic config file (well, more or less like the comment in line 28). However, I have not found the documentation/reference regarding referencing the whole router object configuration (traefik.http.routers.<router-name>). The closest documentation I found is this and this, but it doesn't mention anything about referencing the whole router object.

Heziode commented 2 years ago

Hi,

After checking, it turns out that this line is indeed useless. Thank you for pointing this out, I will remove it.

Heziode commented 2 years ago

Fixed with 27c8675617c7bd1e3953476f3c3fd239075b0a47.

mangkoran commented 2 years ago

Thank you for your attention! A bit out of the issue topic tho: I also found that these lines could be removed as well: https://github.com/Heziode/traefik-v2-https-ssl-localhost/blob/27c8675617c7bd1e3953476f3c3fd239075b0a47/docker-compose.yml#L24-L27

- labels: 
-   # Enable this container to be mapped by traefik 
-   # For more information, see: https://docs.traefik.io/providers/docker/#exposedbydefault 
-   - "traefik.enable=true" 

Because, when I checked the Traefik API dashboard, I found that it will create a new router-service for traefik container which is unreachable from the host.

With traefik.enable in traefik container: chrome_gYi3MDOeXq

Without traefik.enable: chrome_DZZbx9VdQH

The latter is also able to reach the Traefik API dashboard via https://traefik.docker.localhost.

Heziode commented 2 years ago

Indeed, I just removed it too.