Welcome! Log In Create A New Profile

Advanced

Make nginx ignore unresolvable upstream server host names during reload or boot up

March 08, 2018 01:36AM
Hi,

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

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?
Subject Author Posted

Make nginx ignore unresolvable upstream server host names during reload or boot up

shivramg94 March 08, 2018 01:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 214 on March 20, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready