Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP-FPM status page is blank after nginx update from 1.2.1 to 1.9.2

Tags:

php

nginx

status

I've been using Nginx 1.2.1 for a while now, and because of security issues, I decided to upgrade to 1.9.2.

Problem is : php-fpm status page is now serving me a fully blank page. HTTP response code says : 200 ok, but content = 0 bytes

What I tried :

Checking Nginx user / group : it's www:www (as it was before) Checking Php-FPM user / group : it's www:www (as it was before) During aptitude upgrade, I chose to keep my config files

tail /var/log/nginx/error.log says : nothing tail /var/log/nginx/mywebsite-error.log says : nothing tail /var/log/php-fpm/php5-fpm.log says : nothing except some process trace finished but nothing relevant

I've been using this code before the upgrade, no problem :

    location ~ ^/(php_status|ping)$ {
    # access_log off;
    allow 127.0.0.1;
    allow MY_IP_ADRESS;
    deny all;
    include fastcgi_params;
    fastcgi_pass    unix:/var/run/php5-fpm.sock;
}

Therefore, I tried using the syntax :

fastcgi_pass 127.0.0.1:9000;

but that leads to a 502 from nginx and I don't think the issue is there.

I'm running out of options ...

Thanks you for your help.

like image 313
Sorcy Avatar asked Oct 28 '15 21:10

Sorcy


2 Answers

Try this:

location ~ ^/(php_status|ping)$ {
    # access_log off;
    allow 127.0.0.1;
    allow MY_IP_ADRESS;
    deny all;
    include fastcgi_params;

    # This is important
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_pass    unix:/var/run/php5-fpm.sock;
}
like image 50
Tuanitim Avatar answered Sep 23 '22 19:09

Tuanitim


Seems it's enough to add only

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
like image 37
Yurii Avatar answered Sep 22 '22 19:09

Yurii