Nginx + PHP-FPM status page

I was working on collecting metrics from PHP FPM via Nginx and found following post on how to set this up: https://rtcamp.com/tutorials/php/fpm-status-page/ however this was producing empty documents for me until I found on some forum that following code needs to be added to the config:

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;

after adding this my config looks like the following block and I can see all the PHP-FPM stats I need.

location ~ ^/(status|ping)$ {
    access_log off;
    allow 127.0.0.1;
    deny all;
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
}
Posted in Linux, Sysadmin | Leave a comment