Docker Community Forums

Share and learn in the Docker community.

Cannot browse Owin API from localhost, can from External


(Talmcmahon) #1

I have Docker containers running in Windows 10.

I have made a simple Owin based console app that responds to a "Get"
I have made it into a container and run it using several different ports.
I run it using this command:

docker run -it -p 81:80 --name one web_node
If I browse from on this box it always fails with the following message:
“This site can’t be reached”
“localhost refused to connect.”

If I browse from an external box It succeeds.

When I browse any of the following while on my box (I have tried both ports 80 and 81) It fails.

localhost/api/values
127.0.0.1/api/values
boxName/api/values
10.0.0.147/api/values (my boxes IP)

From External box When I use

10.0.0.147/api/values (my boxes IP)
boxName/api/values

It succeeds.

I have uninstalled IIS on my box to make sure to avoid collisions
I have tried adding 127.0.0.1 to host file
I can ping all of the addresses listed above.

Thoughts?


(Artoflife) #2

Not sure, if it’s related, but I have some similar issue accessing container’s proxy. When I tried to connect from host OS, it worked only using localhost and failed using container’s internal IP (with connection refused message).

However, when I tried to establish connection between containers, only internal IP worked. It seems strange to me, as on Linux I could use internal IP for both cases.


(Talmcmahon) #3

So I have done plenty of hunting, It would seem to be a case of “you can’t.” Here is a link to a description of what is going on and if you skip to the limitations portion, it says you cannot browse from the host to a virtually mapped endpoint via the external mapping.

https://blogs.technet.microsoft.com/virtualization/2016/05/25/windows-nat-winnat-capabilities-and-limitations/