alibaba / tengine

A distribution of Nginx with some advanced features

Home Page:https://tengine.taobao.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic resolve not works if domain is not available at startup

zdm opened this issue · comments

Ⅰ. Issue Description

Hi.

Configuration:

dynamic_resolve        fallback=next fail_timeout=3s;
server                task.core-core:80;

Tengine starts inside docker swarm.

task.core-core - is the docker service, which can be NOT resolvable at atart time.

If it is not resolved tengine throw error:

nginx: [emerg] host not found in upstream

and this server never started, even if task.core-core become available later.

Expected behavior

If domain is not resolved tengine should re-check it using fail_timeout parameter and add upstreams, when they will be gound,

If it is required by nginx that upstream mush contains at least one server and we can;t resolve domain at startup - we can add some fake ip address. for example:

server     0.0.0.1:1 down;

and remove it later, when domain will be resolved.

not actual already