1

Iam new to nginx and I have this issue I can't understand.

Iam using nginx as a load balancer to three cloud servers.This is nginx configuration :

upstream dummyname  {
      server #.#.#.# weight=1;
      server #.#.#.# weight=1;
      server #.#.#.# weight=1;
    }

server {
listen 80;
root /var/www/html;
try_files /maintenance.html $uri $uri/index.html $uri.html @proxy;
server_name localhost;
location @proxy {
proxy_pass  http://dummyname;
}
}

My problem appeared when I destroyed one of them with its ip still in the upstream i started to get this error :

ERROR
The requested URL could not be retrieved

The following error was encountered while trying to retrieve the URL: http://dummyname

Unable to determine IP address from host name "dummyname"

The DNS server returned:

Name Error: The domain name does not exist.

This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.

Your cache administrator is webmaster.

After tracing that error I figured out that the problem was in the ip of the removed server, and if I removed that ip from my upstream it works fine.

Now isn't nginx should balance the load and neglect any nonworking ips or is that normal or Iam doing something wrong? any references are very appreciated.

Thanks in advance.

1 Answer 1

1

You should raise fail_timeout value in upstream block, so failed server will be longer marked as failed.

(quote from nginx docs, bold is mine) from http://nginx.org/en/docs/http/ngx_http_upstream_module.html

fail_timeout=time sets the time during which the specified number of unsuccessful attempts to communicate with the server should happen to consider the server unavailable; and the period of time the server will be considered unavailable. By default, the parameter is set to 10 seconds.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .