Я использую nginx с PHP-FPM
Мое приложение требует, чтобы все URL-адреса были перенаправлены на index.php
(см. Nginx conf)
location / {
root /var/www/app/public/
try_files $uri /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
try_files $fastcgi_script_name =404;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
Для анализа некоторые проблемы с производительностью я хотел использовать страницу статуса fpm. Но на странице состояния не отображается реальный URI запроса
pid: 1369
state: Idle
start time: 03/Sep/2018:17:34:34 +0200
start since: 15
requests: 4
request duration: 29796
request method: GET
request URI: /index.php
content length: 0
user: -
script: /var/www/app/public/index.php
last request cpu: 67.12
last request memory: 6291456
Так что трудно сказать, какая страница в настоящее время обрабатывается - возможно ли добавить дополнительную информацию на страницу fpm-status или изменить URI запроса?
Вы должны добавить отдельный блок с набором fastcgi_index
:
location ~ ^/_status$ {
include fastcgi_params
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# the following is optional but nice to have
# it will restrict access to the local monitoring system
access_log off;
allow 127.0.0.1;
allow ::1;
deny all;
}
До сих пор нет ответа, ошибка была обнаружена более 5 лет назад наhttps://bugs.php.net/bug.php?id=72319без ответа.