apache + php-fpm:Apache突然将一些png请求转发给php-fpm


apache + php-fpm: Apache forwarding some png requests to php-fpm suddenly

最近在带有apache的服务器上设置了PHP-FPM,它运行得非常好,但是我无法访问的某些png文件被拒绝

,例如 https://socialsavanna.com/scripts/candy-1.6.0/res/img/action/statusmessage-off.png

在我收到的错误日志中

FastCGI: server "/{DirectoryToCGIBin}/php5-fcgi" stderr: Access to the script '/{DirectoryToWebsite}/scripts/candy-1.6.0/res/img/action/statusmessage-on.png' has been denied (see security.limit_extensions)

其他 png 工作正常,为什么 Apache 将其转发到 FastCGI 以解析为 PHP 文件? 任何想法我如何阻止这种情况?

谢谢

编辑:配置

LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_fastcgi.c>
    DirectoryIndex index.php index.html index.shtml index.cgi
    AddHandler php5-fcgi .php
    Action php5-fcgi /php5-fcgi
    Alias /php5-fcgi /{DirectoryToCGIBin}/php5-fcgi
    FastCgiExternalServer /{DirectoryToCGIBin}/php5-fcgi -socket /{socketPath}/php5-fpm.sock -pass-header    Authorization
    # For monitoring status with e.g. Munin
    <LocationMatch "/(ping|status)">
            SetHandler php5-fcgi-virt
            Action php5-fcgi-virt /php5-fcgi virtual
    </LocationMatch>

很明显,

您的 LocationMatch 在正则表达式中具有"状态",它与您的文件名 statusmessage-on.png 匹配。

如果没有您期望匹配的更多细节,就很难建议如何使其更具体。 如果您的意思是 URL 以上述任一内容开头,请尝试

<LocationMatch "^/(ping|status)">