1.nginx default 配置增加

location ~ ^/(status|ping)$
        {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
        }
登录后复制
登录后复制

2.开启pm.status = /status
3.重启nginx和fpm,service nginx restart,service php-fpm restart

访问:http://192.168.10.10/status
结果:404

回复内容:

1.nginx default 配置增加

location ~ ^/(status|ping)$
        {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
        }
登录后复制
登录后复制

2.开启pm.status = /status
3.重启nginx和fpm,service nginx restart,service php-fpm restart

访问:http://192.168.10.10/status
结果:404

Nginx:
    location ~ ^/(status|ping)$ {
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index  index.php;
    }
登录后复制

我试了,访问/status能正常输出PHP-FPM的工作信息.
你是不是访问时在/status后面多加了个/,这时就会返回404了.

09-17 19:29