0

我在 chroot( archlinux wiki)中安装了 arch linux 和 nginx 。那是有效的。

现在我想让 fastcgi 运行。我将 php-fpm 套接字设置为 127.0.0.1:9000 以从 chroot (/srv/http) 访问它。

虽然 html 文件打印成功,但 php 文件“未找到”。在 nginx 日志中,我发现了这个:

FastCGI sent in stderr: "primary script unknown" while reading response header from upstream, client: 10.211.55.2, server: localhost, request: "GET /phpinfo.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000:, host: "10.211.55.6".

所以我认为 php-fpm 没有找到该文件,因为路径在 nginx chroot 中是绝对的,它在真正的根目录中搜索。所以我在我的设置中添加了,是的,非常难看,但结果没有改变。我怎样才能调试它,或者更好地找到一个干净的解决方案?

location ~ \.php$ {
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    include       fastcgi_params;
    fastcgi_param SCRIPT_FILENAME  /srv/http$document_root$fastcgi_script_name
}

坦克很多。

4

0 回答 0