title: Nginx PHP-FPM Health Check
body: <p>I want to write a health check that takes Nginx and PHP-FPM into account. Currently my health check works as such:</p>
  <pre><code>server {
      listen       80;
      server_name  www.example.com;
  
      location /nginx-health {
          access_log off;
          return 200 &quot;healthy\n&quot;;
      }
  
  }
  </code></pre>
  <p>The problem is sometimes nginx will be totally healthy, but the connection to the upstream, php-fpm, is not working. In which this health check will errousenly return healthy. How can a health  also check php-fpm?</p>