Fastcgi_pass, resolver, and validating functionality.

ahamilton9 nginx-forum at forum.nginx.org
Tue Dec 6 17:43:50 UTC 2016


I have an nginx server (1.10.1) configured that sends requests for PHP files
to our PHP tier by directing that traffic via fastcgi_pass to our PHP ELB
(AWS's Elastic Load Balancer). We occasionally get outages that a hard
stop/start of nginx solves, but are having trouble narrowing the issue down.
We believe it is related to DNS resolution, which brings me here. I have a
few questions:

1) Does using a variable in fastcgi_pass actually allow the resolver to run,
or is it just for proxy_pass as I've seen in 90% of examples?

2) Is this configuration valid? It WORKS, but the resolution doesn't seem to
do anything, or I'm not sure how to check that it's updating. The server's
resolv.conf points to the same DNS server and uses a search domain so
"php:9000" does work:

http {
    resolver x.x.x.x valid=10s;
    
    server {
        set $phproute "php:9000";
        
        location ~ \.php$ {
            include /etc/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
            fastcgi_pass $phproute;
        }
    }
}

3) How do I validate that the resolver is working properly outside of
waiting for an outage again? Is there a way to get the current cached DNS
entries from nginx to compare? I found a tcpdump command, but I'm not really
sure what I'm looking at, and it usually gives me no data. Is there a better
method?

Thanks in advance. I'm really at a loss here.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,271373,271373#msg-271373



More information about the nginx mailing list