Reputation:
I'm studying Docker Desktop, and I have a question.
I have created two ASP.NET Core applications that are listening on the same port. I would like to have them respond by name (i.e.: http://app1.local/
and http://app2.local/
). Is it possible with Docker?
Thanks
Upvotes: 0
Views: 625
Reputation: 25070
You can only have one process listening on a given port, so to achieve what you want, you can have a reverse proxy listening on the port and direct traffic to the applications behind, based on the host name in the request.
Some options for reverse proxies are Nginx, Traefik or the Ocelot library for .NET.
Upvotes: 0