500 Internal Server Error for Forward Auth pointed to local docker container

I've successfully setup Traefik to act as a router for multiple docker containers with no auth, but I'm having trouble with adding forward authentication where the auth server is another container on the same cluster

Excerpt from Traefik.toml:
address = "localhost/auth"

Testing the container by hitting its ip directly gives the correct response for the headers I've specified, so the auth container itself is not the problem.

Is there some configuration that I'm missing here?

Edit: There is no conflicting command for entrypoints when specifying the traefik container in docker-compose.yml. The Auth container is defined as a service in the same docker-compose.yml as all the others, all on the same default network
image: auth
- 80

Hello @ratchet5000,

Your endpoint:
address = "localhost/auth"

Localhost in a container is the container itself...

So you want to query traefik at /auth?

Using localhost in a containerized environment is almost never a good idea :wink:

So how would I be able to point Traefik's forward auth address to another docker container in the same cluster?

By stack/service/container name?

Docker maintains internal DNS for this very reason.

I tried [container name]/auth with the same 500 error response as well.

Fixed the problem at least for direct IP address, just needed "http://" in the string for traefik to hit the auth container correctly. Looks like I'll also need to setup a DNS for my containers if I don't want to change the IP that I give to traefik for forward auth every single time I call up on docker compose.