Hi Payam,
I’m not doing any caching. It looks like it is indeed a DNS problem, as the
Docker containers are occasionally changing their IP address as the containers
are restarted, but as Ángel pointed out, nginx does not resolve the name at
each request, but only when it loads the configuratio
On my staging server, I stopped container aaa (with IP address x.x.x.5); I then
restarted container bbb (with IP address x.x.x.6); finally, I started aaa
again. As expected, when bbb restarted it claimed aaa’s old IP address, since
it was the lowest available address. When aaa started back up,
I'll bet that's it! There is nothing in my configuration that makes the IP
addresses of the containers in the Docker network stay fixed. I would not be
surprised if, when two or more containers are restarted (as they probably are
every once in a while when logrotate runs), some or all of them
might
help diagnose this. I have never seen nginx behave like this before (I have
used it to host multiple Rails sites for years without any problems—only not in
combination with Docker).
Any suggestions as to what to look for or what to try would be most appreciated.