© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
3 replies
Corn

Docker-compose not working with localhost redirect

I'm kinda new with docker and yarp so I probably made some basic mistake.

For context: I have a yarp gateway created in asp.net core web api and a micro-service also in asp.net core web api. When I go to the gateway url I want it to redirect to the micro-service. I was able to get this to work in two seperate containers.

However when I try to use docker-compose it wont work. The error I get the most is (http error 503) cannot assign requested address from my docker container. I have tried host.docker.internal but it yielded no results.

System.Net.Http.HttpRequestException: Cannot assign requested address (localhost:5101)
2024-03-12 10:06:02        ---> System.Net.Sockets.SocketException (99): Cannot assign requested address
System.Net.Http.HttpRequestException: Cannot assign requested address (localhost:5101)
2024-03-12 10:06:02        ---> System.Net.Sockets.SocketException (99): Cannot assign requested address


I can't send the rest of the code as it's too long for this message xd
It can be viewed here however "https://stackoverflow.com/questions/78145912/docker-compose-not-working-with-localhost-redirect"
Stack Overflow
Docker-compose not working with localhost redirect
I'm kinda new with docker and yarp so I probably made some basic mistake.
For context: I have a yarp gateway created in asp.net core and a micro-service also in asp.net core. When I go to the gatew...
Docker-compose not working with localhost redirect
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ doubts with docker-compose
C#CC# / help
3y ago
❔ ✅ problem with docker compose build
C#CC# / help
3y ago
Visual Studio integration with Docker Compose not functioning as expected.
C#CC# / help
13mo ago
❔ Get Console App args inside Docker container with Docker-compose
C#CC# / help
3y ago