# Expose dashboard as subdomain

**URL:** <https://community.traefik.io/t/expose-dashboard-as-subdomain/17986>\
**Category:** Traefik v2\
**Tags:** dashboard-api\
**Created:** [March 20, 2023, 1:46pm UTC](https://community.traefik.io/t/expose-dashboard-as-subdomain/17986 "2023-03-20T13:46:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vonlani](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/vonlani/32/6844_2.png) [@vonlani](https://community.traefik.io/u/vonlani)\
**Post date:** [March 20, 2023, 1:46pm UTC](https://community.traefik.io/t/expose-dashboard-as-subdomain/17986/1 "2023-03-20T13:46:58Z")

</div>

I have recently switched to traefik as a reverse proxy for a view self hosted services (from nginx), everything is dockerized and I was able to migrate all my services by attaching the Traefik labels to the docker configs.

However I fail do expose the traefik dashboard itself as a subdomain using tls, I can only access it through local lan access. I'm trying like this.

static config

```auto
api:
  dashboard: true
  insecure: true

certificatesResolvers:
  myresolver:
    acme:
      email: "XXX"
      storage: "/letsencrypt/acme.json"
      tlsChallenge: {}

entryPoints:
  websecure:
    address: ":443"

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

```

docker-compose

```auto
  traefik:
    image: "traefik:latest"
    container_name: "Traefik"
    restart: unless-stopped
    ports:
      - "443:443"
      - "8080:8080"
    labels:
      - "traefik.http.routers.dashboard.rule=Host(`proxy.<MY DOMAIN>`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.entrypoints=websecure"
      - "traefik.http.routers.dashboard.tls=true"
      - "traefik.http.routers.dashboard.tls.certResolver=myresolver"
    volumes:
      - traefik_data:/letsencrypt
      - $CONFIG_ROOT/traefik/traefik.yml:/etc/traefik/traefik.yml
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

```

This is what I get in the logs:

```auto
time="2023-03-20T13:42:38Z" level=debug msg="Serving default certificate for request: \"proxy.<MY DOMAIN>\""
time="2023-03-20T13:42:38Z" level=debug msg="http: TLS handshake error from <IP>:51985: EOF"

```

Any helps appreciated.

---

<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:** [March 21, 2023, 7:32am UTC](https://community.traefik.io/t/expose-dashboard-as-subdomain/17986/2 "2023-03-21T07:32:37Z")

</div>

Is your domain externally available on port 443?

Is your acme.json writeable?

In general your config looks okay, compare to a working [simple example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-traefik-dashboard-letsencrypt).

Update: remove `insecure: true`, that will explicitly setup dashboard without TLS on port 8080, see [docs](https://doc.traefik.io/traefik/operations/dashboard/#insecure-mode).
