Nginxでupstreamにホスト名を指定したら起動時に名前解決される
As long as you write host names in nginx configuration, nginx will
resolve these names while parsing the configuration. It won't
notice any changes unless the configuration is reloaded.
If you want nginx to periodically re-resolve names, there are two
options available:
1) Use proxy_pass with variables:
resolver 127.0.0.1;
set $upstream "backend.example.com";
When variables are used in the "proxy_pass" directive, nginx
for details.
(略)
GKEでNginx動かしてる時に、アプリケーションのポッドを作り直したりしているとIPアドレス変わるけど、リバースプロクシーとして使ってるNginxがそれに追従してくれなくて困って調べてた。