(I have read and applied the recomendations here - it did not resolve my issue).
I am trying to read the PHP-FPM status page on Ubuntu 20.04 LTS. This is using the packaged PHP/PHP-FPM (7.4.3) and nginx (1.18.0)
In /etc/php/7.4/fpm/pool.d/www.conf, I have uncommented the line:
pm.status_path = /status
(and restarted php7.4-fpm). In my default server conf I have added:
location /status {
allow 10.0.0.0/8;
allow 127.0.0.1;
deny all;
# include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
(and reloaded nginx. The commented out entry was a slightly different fcgi config I use elsewhere - it doesn't work either). I have also tried adding a try_files $uri $uri/ =404;
withing the location block - no change in behaviour. I am connecting from an allowed address - and commenting out the allow/deny lines has no impact on the behaviour:
- accessing http://$MYSERVER/status returns a 404
- Adding a directory named status in the document root results in a 403 (directory listing not allowed).
- If I place a PHP script in $DOCROOT/status/ it is executed when I enter its URL in my browser - so the request is being passed off to PHP-FPM.
There is nothing reported in /var/log/php7.4-fpm.log nor /var/log/nginx/error.log . The access.log only reports the 403/404 status.
It appears that php-fpm is simply not intercepting the request but is handing it off to PHP.
I have also tried with a different string for pm.status_path. Same result.
How can I get further insights / fix this issue?