wuhemei

144 经验值

我也是这样配置的 想问问是什么问题

pstream backend {
    server 10.120.0.2;
    server 10.120.0.3;
}

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name xxx.com www.xxx.com;

    location / {
        add_header X-Content-Type-Options nosniff;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_hide_header X-Powered-By;
        proxy_hide_header Vary;

        proxy_pass http://backend;
        proxy_redirect off;
    }

}

我用的也是digitalocean的服务器 我用app-lb服务器的ip浏览器访问 nginx的error.log直接报

[error] 9634#9634: *1 connect() failed (113: No route to host) while connecting to upstream, client: x.x.x.x, server: x.x.x.x request: "GET /favicon.ico HTTP/1.1", upstream: "http://10.120.0.3:80/favicon.ico", host: "x.x.x.x", referrer: "http://x.x.x.x/"
 [error] 9634#9634: *1 connect() failed (113: No route to host) while connecting to upstream, client: x.x.x.x, server: x.x.x.x, request: "GET /favicon.ico HTTP/1.1", upstream: "http://x.x.x.x:80/favicon.ico", host: "x.x.x.x", referrer: "http://x.x.x.x/"