openresty / docker-openresty

Docker tooling for OpenResty
https://hub.docker.com/r/openresty/openresty
BSD 2-Clause "Simplified" License
935 stars 525 forks source link

Openresty cannot able to resolve DNS changes #223

Closed gokulkr535 closed 1 year ago

gokulkr535 commented 1 year ago

I wanted to build docker based api proxy . So i decided to use openresty as my base image and currently exploring about it.

when i was testing i found a weird issue. DNS changes are not picked up docker container if base image is open-resty.-centos

For example, i have following upsteam block :

upstream restapi { server rest-api.test.com; keepalive 16; }

Assume, rest-api.test.com which is pointed to 1.2.3.4 . all incoming traffics are going to 1.2.3.4

at some point of time, i am doing DNS cutover from 1.2.3.4 to 11.22.33.44.

After cutover ,still traffics are going to 1.2.3.4 instead of 11.22.33.44. but i can resolve latest IP from VM. in docker container still it was pointed to Old IP.

@neomantra , i need your inputs to resolve this issue .

neomantra commented 1 year ago

Related to this #165. You need to resolve yourself or use a commercial Nginx with dynamic upstream support (unless that's changed in the years since that ticket; I don't use it). Search term might be "OpenResty upstream dns resolution".