开启php-fpm status功能,访问domain/status,结果404?
程序员文章站
2022-04-19 16:22:58
...
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了.