curl:(7)无法连接到localhost端口8090:连接被拒绝
需要帮忙.一直试图找到解决这个问题的方法,看不到答案,或者说我没有遇到任何问题.
我有一个带NGINX的docker容器,充当反向代理. Docker for Windows 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;
}
}
在上面的代码中,localhost:8090是在我的主机上的IIS上托管的网站的URL.当我访问NGINX上的URL时,我收到以下错误
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" "-"
试图访问主机上的URL
(simple HTML site, single page with only simple html, hosted on IIS with anonymous access granted to all.)
curl localhost:8090
收到以下错误:
curl: (7) Failed to connect to localhost port 8090: Connection refused
我是Docker和NGINX的新手.想知道是否可以访问主机上的URL?如果是,那么我错了.
如果我使用google.co.in而不是127.0.0.1:8090,则相同的配置有效.
谢谢.