Skip to content

Compose service domain may keep returning 502 until the domain is deleted and recreated #3945

@sercherton

Description

@sercherton

To Reproduce

Problem

A domain attached to a Docker Compose sub-service may return 502 Bad Gateway even though the target container is healthy and the app responds correctly on the configured internal port.

A normal redeploy does not always fix it.

What fixes it reliably is:

  1. delete the domain in Dokploy
  2. create the same domain again
  3. redeploy / refresh routing

Expected

If a Compose sub-service is healthy and the domain points to the correct internal port, redeploy should be enough.

Deleting and recreating the domain should not be required.

Actual

  • container is up
  • service responds correctly inside the container
  • public domain still returns 502

Current vs. Expected behavior

Example:

docker exec <container> sh -lc 'wget -qO- http://127.0.0.1:8080/healthz'
{"status":"ok"}

curl -fsS https://<domain>/healthz
curl: (22) The requested URL returned error: 502

### Provide environment information

```bash
ubuntu 24.04
Dokploy Version v0.28.4
Compose App

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Remote server

Additional context

No response

Will you send a PR to fix it?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions