Curl: (7) Failed to connect to localhost port 8090: connection refused

Help is needed. We tried a solution to this problem and could not see the answer, or rather, I did not come across it.

I have a docker container with NGINX acting as a reverse proxy. Docker for Windows version 1.12.5 (9503).

upstream mysite {
    server 127.0.0.1:8090;
    #server localhost:8090; (have also tried this option)
}

server {
    listen 0.0.0.0:80;
    server_name  localhost;

    location / {
        proxy_pass http://mysite;
    }
}

In the above code, localhost: 8090 is the URL of the website hosted by IIS on my host machine. When I access the NGINX URL, I get the following error:

2016/12/27 08:11:57 [error] 6#6: *4 no live upstreams while connecting to upstream, client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://googlesite/", host: "localhost"
172.17.0.1 - - [27/Dec/2016:08:11:57 +0000] "GET / HTTP/1.1" 502 173 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0" "-"

Tried to access the url on the host machine

(simple HTML website, one page with simple html hosted in IIS with anonymous access granted to everyone.)

curl localhost:8090

Getting the following error:

curl: (7) Failed to connect to localhost port 8090: Connection refused

Is new to Docker and NGINX. I would like to know if it is possible to access the URLs on the host machine? If so, where am I mistaken.

, google.co.in 127.0.0.1:8090.

.

+4
1

localhost 127.0.0.1 . -, dockerd , /IP, .

+11

Source: https://habr.com/ru/post/1665119/


All Articles