I have multiple upstream servers configured in an upstream block in my nginx

upstream example2 {
    server example2.service.example.com:8001;
    server example1.service.example.com:8002;

server {
   listen 80;
   server_name example2.com;
   location / {
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_pass http://example2/;

When i try to reload Nginx and at that time if one of my upstream servers
(say example2.service.example.com) is not DNS resolvable, then the reload
fails with an error "host not found in upstream".

Is there any way we can ask nginx to ignore such unresolvable host names or
rather configure Nginx to resolve these upstream server host names at run
time instead of resolving it during the boot up or reload process?

Posted at Nginx Forum: 

nginx mailing list

Reply via email to