nginx caches resolved DNS names. As an effect, when restarting a number of services in the backend, nginx may incorrectly direct proxy requests.
The reason is that each service may get a different IP address when it starts. The best case is that docker assigns a new (previously unused) IP address to created service, in which case nginx will have no upstream to direct the requests to. The worst case is that service that had one address before restart, gets a new IP address that was used by another service. In this case, nginx will direct requests to incorrect service and accessing endpoints will return 404.
- try to figure out if proxy_pass with variable and a resolved fix the problem
- provide a helper that sends SIGHUP to nginx if addresses change