Host not found in upstream

Hello,
I use nginx server as a reverse proxy for a lot of diferent origins.
Many virtualhosts with many upstream servers. I dont have total control
of hostnames that will be configured on upstreams.This configuration
will be done automatically based on what my clients configure on my
solution CP. So I have some problems:

  • One client can use invalid or wrong values, that does not resolver
    and put down all my server.
  • I dont have control of hostname, if client make any change to the
    hostname or put down his dns server my nginx server can stop.
  • If nginx cant contact my resolver all my soltion will go down

Use ip or hosts file is not a option because of environment
variability.
I see this post Re: Nginx reverse proxy crash when dns unavailable about the
problem. I dont found any soltions for it.

Can that problem or behavior can be easy treaty by a patch? Nginx
developer team have a roadmap or intent to change it? Can i pay for a
patch that workaround this problem?

Thanks

Sky

Posted at Nginx Forum:

Hi,

I am interested in this as well (dynamic setup in a proxmox/openVZ
environment where the hostname abstraction is quite useful as (virtual)
network adapters change often)
What is so bad about the following:

  • Try to resolve all names on startup and put them in the DNS in-memory
    cache (current behaviour)
  • just ignore non-resolvable hosts but log an error (new behaviour)
  • if there is a request to the a non-resolvable host, try to resolve it
    again (gethostbyname()) and if successful, put it in the in-memory cache
    (new behaviour).
  • Alternatively/Additionallly, do step 1 every couple of minutes to
    update the cache

Would really help!

Thanks and regards,
fatzopilot

Posted at Nginx Forum: