7
votes

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.

2
You try restarting PHP-FPM?Panama Jack
many times, and nginx tooSorcy
I would upgrade php5-fpm as well. Then read the following documentation on setting up configuration files with nginx: nginx.org/en/docs/beginners_guide.html This documentation goes through setting up the fastcgi proxy as well.whitwhoa
I did a full aptitude upgrade alreadySorcy

2 Answers

33
votes

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;
}
15
votes

Seems it's enough to add only

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;