# Beginner try to configure traefik

**URL:** <https://community.traefik.io/t/beginner-try-to-configure-traefik/6774>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [July 5, 2020, 8:01pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774 "2020-07-05T20:01:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![siriusk222](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/siriusk222/32/2261_2.png) [@siriusk222](https://community.traefik.io/u/siriusk222)\
**Post date:** [July 5, 2020, 8:01pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/1 "2020-07-05T20:01:57Z")

</div>

Hi,  
I start with traefik last week, but I still have problem to acces to service.  
I have create a docker-compose file with traefik and whoami.  
I can acces to traefik dashboard but not to whoami.  
I have installed docker on virtual machine (srvdocker). the domain name comes from the dns in the internet router (free.box)  
[http://srvdocker.free.box/dashboard/#/](http://srvdocker.free.box/dashboard/#/) **works**  
[http://whoami.srvdocker.free.box/](http://whoami.srvdocker.free.box/) **do not work**

here is the docker-compose.yml

```auto
version: "3"

services:
  traefik:
    image: traefik:v2.2
    ports:
      - "80:80"
      - "443:443"
    command:
      - --entryPoints.web.address=:80
      - --entryPoints.websecure.address=:443
      - --api
      - --providers.docker.exposedByDefault=false
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.http_traefik.service=api@internal"
      - "traefik.http.routers.http_traefik.rule=Host(`srvdocker.free.box`)"
      - "traefik.http.routers.http_traefik.entrypoints=web"

  whoami:
    image: containous/whoami:v1.3.0
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami_http.rule=Host(`whoami.srvdocker.free.box`)"
      - "traefik.http.routers.whoami_http.entrypoints=web"

```

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [July 5, 2020, 8:41pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/2 "2020-07-05T20:41:42Z")

</div>

It looks like an incredibly simple setup. What error are you getting ?  
Are you certain the DNS is resolving correctly?

---

<div class="post-metadata">

**Author:** ![siriusk222](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/siriusk222/32/2261_2.png) [@siriusk222](https://community.traefik.io/u/siriusk222)\
**Post date:** [July 6, 2020, 9:30am UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/3 "2020-07-06T09:30:02Z")

</div>

On any remote PC I can ping srvdocker.free.box  
so, I supose it is working

Please not I don't really have a DSN server. I have a Internet router that have a DHCP server. My virtual server **srvdocker** (Ubuntu 18.04) get his IP from this DHCP and automatic domain name from this routeur (free.box).

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [July 6, 2020, 12:44pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/4 "2020-07-06T12:44:16Z")

</div>

> [@siriusk222](#):
>
> On any remote PC I can ping srvdocker.free.box  
> so, I supose it is working

A ping is not something that Traefik would respond to. Ping uses ICMP which is not a protocol that traefik supports(TCP,UDP,HTTP).

Again. What error are you getting?

> [@siriusk222](#):
>
> Please not I don't really have a DSN server. I have a Internet router that have a DHCP server. My virtual server **srvdocker** (Ubuntu 18.04) get his IP from this DHCP and automatic domain name from this routeur (free.box).

The name you get from the provider is fine, assuming it resolves on the internet. Even if it doesn't you can use different rules for your Traefik routes.

---

<div class="post-metadata">

**Author:** ![siriusk222](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/siriusk222/32/2261_2.png) [@siriusk222](https://community.traefik.io/u/siriusk222)\
**Post date:** [July 6, 2020, 7:42pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/5 "2020-07-06T19:42:57Z")

</div>

I just try to reach [http://whoami.srvdocker.free.box/](http://whoami.srvdocker.free.box/) and nothing happend  
If I use [http://srvdocker.free.box/whoami](http://srvdocker.free.box/whoami) then I get this message : 404 page not found

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [July 6, 2020, 7:54pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/6 "2020-07-06T19:54:52Z")

</div>

You mentioned that srvdocker.free.box is automatically generated for you, how is whoami.srvdocker.free.box generated.

It would need to be a resolvable address. `dig whoami.srvdocker.free.box` and see if an address is returned.

> [@siriusk222](#):
>
> If I use [http://srvdocker.free.box/whoami](http://srvdocker.free.box/whoami) then I get this message : 404 page not found

404 is better, it means traefik is reachable at `srvdocker.free.box`. But your Traefik router rules are not configured to handle /whoami. If you update the whoami\_http rule to `(Host(`srvdocker.free.box`) && PathPrefix(`/whoami`))` then you request should reach the whoami container.

---

<div class="post-metadata">

**Author:** ![siriusk222](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/siriusk222/32/2261_2.png) [@siriusk222](https://community.traefik.io/u/siriusk222)\
**Post date:** [July 6, 2020, 8:13pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/7 "2020-07-06T20:13:29Z")

</div>

this works: `(Host(`srvdocker.free.box`) && PathPrefix(`/whoami`))`

`dig whoami.srvdocker.free.box` : no address returned  
`dig srvdocker.free.box` : address is returned

what should I do, if I want to use some thing like  
whoami.srvdocker.free.box  
or  
whoami.free.box

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [July 6, 2020, 8:34pm UTC](https://community.traefik.io/t/beginner-try-to-configure-traefik/6774/8 "2020-07-06T20:34:52Z")

</div>

Usually you would register the fqdn in your domain registrar. You may be able to register additional hostnames with your hosting provider.
