Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.