I would like to use Nginx in front of a number of dockers containers, some of which (known) may be missing. Make sure that nginx does not block on "host not found" and stop the container which then restarts in a loop!
upstream frontend-ups {
server frontend:80 max_fails=3 fail_timeout=5s;
server 127.0.0.1 backup;
}
upstream api-ups {
server api:8080 max_fails=3 fail_timeout=5s;
server 127.0.0.1 backup;
}
But nginx alws clams : [emerg] 1#1: host not found in upstream "frontend:80" in /etc/nginx/conf.d/default.conf:5
Then solution : https://serverfault.com/a/480273/58035 not work!