Allowing access to /php-status page in an nginx virtual server config

So, my nginx config is an exact copy of the one in the docs;

What I would like to add is a /php-status page, just like I have an /nginx-status page.
For this I added the following config blocks included in the server nginx statement.

           location /nginx-status {
                    stub_status on;
                    allow ::1;
                    deny all;
            location /php-status {
                    allow ::1;
                    deny all;
                    include fastcgi_params;
                    fastcgi_pass unix:/var/run/php-fpm.sock;

The nginx status page is accessible, although the php-fpm status page is not.
I have the following error in my nginx error log file:
May 5 16:15:40 nextcloud nginx: 2020/05/05 16:15:40 [error] 82114#102992: *2 FastCGI sent in stderr: “Access to the script ‘/usr/local/www/nextcloud/phpstatus’ has been denied (see security.limit_extensions)” while reading response header from upstream, client: ::1, server: localhost, request: “GET /phpstatus HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm.sock:”, host: “localhost:8080”
2020/05/05 16:16:22 [alert] 81219#102755: worker process 82114 exited on signal 9
May 5 16:16:22 nextcloud nginx: 2020/05/05 16:16:22 [alert] 81219#102755: worker process 82114 exited on signal 9

Is there any tuning I can do in my nginx config that allows to run this status page?

Thanks in advance!

Anyone? Please

You will not find response here. Its a Nginx question, and Nginx is not the most commonly used server here. Im using Nginx but I cant answer you. For exemple, in stackoverflow or digital ocean.
Look at this, it seems that its the same issue :

It suggests to change the authorized extensions in your php config (/etc/php/7.3/fpm/pool.d/www.conf).
Or you can add .php extension to your php script
Check the right of your directory too.
Good luck
1 Like

Thanks, that is an awesome topic and pointed me in the right direction!
Removing set $path_info $fastcgi_path_info; and fastcgi_param PATH_INFO $path_info; allowed access to the php-status page.

1 Like