Nginxエラー:Nginxログエラーconnect()failed(110:Connection timed out)while connecting to upstream

6269 ワード

プロジェクトの概要
      ,SpringCloud  ,Eureka  10086,zuul  10010,      8001,    9001

環境:
1、    win10,ip:192.168.0.110,      
2、   centos7,ip192.168.0.112,        
3、      host(C:\Windows\System32\drivers\etc\hosts)        192.168.0.112
192.168.0.112   manage.leyou.com   //   
192.168.0.112   api.leyou.com      // zuul
192.168.0.112	www.leyou.com      //   

4、nginx.confファイルに以下の内容を追加
server {
        listen       80;
        server_name  api.leyou.com;

        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        location / {
            proxy_pass http://192.168.0.110:10010;
            proxy_connect_timeout 6000;
            proxy_read_timeout 6000;
        }
    }



    server {
        listen       80;
        server_name  localhost;

       location / {
            root   html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

問題の説明
         manage.leyou.com        ,                 :
2020/04/29 17:48:11 [error] 22845#0: *118 connect() failed (110: Connection timed out) while connecting to upstream, client: 192.168.0.110, server: api.leyou.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://192.168.0.110:10010/favicon.ico", host: "api.leyou.com", referrer: "http://api.leyou.com/api/item/category/list?pid=0"

ブラウザはapiに直接アクセスします.leyou.comにnginxの502ページが表示されます
問題解決
        ,       。