# Health Check Not Using Backend API Docker Hostname

**URL:** https://community.traefik.io/t/health-check-not-using-backend-api-docker-hostname/28077
**Category:** Traefik v3 (latest)
**Tags:** docker, file, middleware
**Created:** [August 2, 2025, 6:28pm UTC](https://community.traefik.io/t/health-check-not-using-backend-api-docker-hostname/28077 "2025-08-02T18:28:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MaxwellAllen216](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/maxwellallen216/32/10593_2.png) [@MaxwellAllen216](https://community.traefik.io/u/MaxwellAllen216)
#### Post date: [August 2, 2025, 6:28pm UTC](https://community.traefik.io/t/health-check-not-using-backend-api-docker-hostname/28077/1 "2025-08-02T18:28:26Z")

</div>

Hi,

I am very new to using Traefik and just want to set it up so I can enable https and use health checks to ensure the API services are healthy before proceeding with the request.

Currently, no matter what I do, the health checks fail because it tries calling the health endpoint without the proper hostname.

**It calls:** https:///api/api/health?type=ready

**When it should call:** [http://api:3000/health?type=ready](http://api:3000/health?type=ready)

The only thing that has worked is if I set the path to the full url, rather than just give it a path. Like this:

services:

```
    api-service:

        loadBalancer:

            servers:

                - url: 'http://api:3000'

            healthCheck:

                path: https://\[domain\].com/api/health?type=ready

                interval: '5s'

                timeout: '2s'

```

I don’t know why this is happening. The only reason I can think of is if it is because my .NET API enables `UseHttpsRedirection`.

Does anyone know how I can fix this? Thanks.

---

<div class="post-metadata">

### Author: ![MaxwellAllen216](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/maxwellallen216/32/10593_2.png) [@MaxwellAllen216](https://community.traefik.io/u/MaxwellAllen216)
#### Post date: [August 2, 2025, 6:32pm UTC](https://community.traefik.io/t/health-check-not-using-backend-api-docker-hostname/28077/2 "2025-08-02T18:32:30Z")

</div>

LMAO, JFC. Nevermind. It indeed was due to `UseHttpsRedirection`. Should have tried it first.
