Connection refused: `127.0.0.1:80` appended to host

Hi, all

I have a system where I'm trying to get two microservices to communicate with each other secured by a Keycloak auth server. I had everything working when running directly on localhost, but once I started dockerizing them I ran into problems. I'm trying to resolve those with Traefik and I almost have it working.

Looking in the Micronaut logs I see

2024-06-22 21:40:08 02:40:08.110 [main] DEBUG i.m.s.o.c.DefaultOpenIdProviderMetadataFetcher - Sending request for OpenID configuration for provider [keycloak] to URL [http://keycloak.psn.local/realms/spike-realm/.well-known/openid-configuration] running in thread main

Which is right. I can copy that into a browser and see my keycloak's OIDC configuration with the correct hosts set.

Then something goes wrong and a short ways later into the logs I see

2024-06-22 21:40:08 02:40:08.119 [default-nioEventLoopGroup-1-7] ERROR i.m.h.client.netty.DefaultHttpClient - Failed to connect to remote
2024-06-22 21:40:08 io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: keycloak.psn.local/127.0.0.1:80

I don't understand where the host has been transformed to add a localhost IP and http port.

I've tried moving these services out of docker and running them directly on the host machine they can reach keycloak successfully, which is what leads me to suspect this is something related to Traefik, but I don't know what.

I pushed the current state of what I'm working on

It seems the domain resolves to localhost. But localhost within a container is not localhost of the host, but only within the container.

I recreated this problem this morning using nginx proxy manager and got the same result. Looks like my problem lies elsewhere. Thanks to any who read and responded!