Our AWS configuration has an nginx server pointing all PHP requests to an ELB with multiple PHP servers in it. When the ELB itself scales, we lose connectivity within the next few hours as those old IPs are recycled. A restart of the nginx servers re-caches the IPs of the ELB, and everything comes back up. Pretty standard stuff.
The solution I've found everywhere is that I need to include a resolver
to allow re-resolution while the server is up and running. The issue I'm running into is two-fold:
- My current configuration isn't working.
- I'm not sure how to properly test it, without waiting for it to fail.
Here's my current configuration:
http {
resolver 10.0.0.2 valid=10s;
...
server {
...
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
set $route "php:9000";
fastcgi_pass $route;
}
}
}
An article I found mentioned using tcpdump to review DNS requests, but I don't see anything at all, and definitely not every 10 seconds as written. Could it have to do with using fastcgi_pass instead of proxy_pass? Am I missing something else?