# Endless 502 / forwarding when calling dashboard via subdomain #6123

**URL:** <https://community.traefik.io/t/endless-502-forwarding-when-calling-dashboard-via-subdomain-6123/3689>\
**Category:** Traefik v2\
**Tags:** dashboard-api, docker\
**Created:** [January 2, 2020, 11:19pm UTC](https://community.traefik.io/t/endless-502-forwarding-when-calling-dashboard-via-subdomain-6123/3689 "2020-01-02T23:19:13Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [January 4, 2020, 8:50pm UTC](https://community.traefik.io/t/endless-502-forwarding-when-calling-dashboard-via-subdomain-6123/3689/12 "2020-01-04T20:50:13Z")

</div>

The `network` option (`providers.docker.network` in the static configuration or `traefik.docker.network` labels in the dynamic configuration) allow to manage the same thing: the way for traefik to get the container IP.

The `traefik.docker.network` label (in the dynamic configuration) overrides the `providers.docker.network` option (in the static configuration )

The `network` option is used by traefik to know on which network the container IP must be taken.  
FYI the IP is different following the network.

This network need to be accessible by Traefik, because the routing of a request will call this IP.

* * *

`api: {}` is the YAML syntax for an empty object, so yes this activate the API with the default values. Same thing for `tlsChallenge: {}`

* * *

> what happen to the Middleware, shown before

When you are using the insecure mode for the API/dashboard, Traefik creates some configuration (internal provider) to handle the API and the dashboard. If you don't use the insecure mode, Traefik doesn't create those elements.

It's not related to the issue you linked.

* * *

Also note that I use a different syntax for labels, because in YAML you can use both syntax to define the value of a map (labels are a map)

Syntax with `-` at the beginning of the line and `=` as separator between the key and the value:

```auto
myMap:
  - "key1=value1"
  - "key2=value2"
  - "key3=value3"

```

Syntax without `-` and with `:` as separator between the key and the value:

```auto
myMap:
  key1: value1
  key2: value2
  key3: value3

```

I prefer the second syntax because, for me, it's a better representation of the real type (a map).

---

_[View the full topic](https://community.traefik.io/t/endless-502-forwarding-when-calling-dashboard-via-subdomain-6123/3689)._
