简体   繁体   中英

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

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.

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

似乎只添加就足够了

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM