nginx php7.0 fastcgi 在路径上返回内部服务器错误

nginx php7.0 fastcgi 在路径上返回内部服务器错误

我正在 ububtu 16.04 服务器上的 nginx 1.10 上配置 php7.0 fpm。在遵循了网络上的数千条说明后,我仍然无法使其正常工作。

我不断在浏览器中收到内部服务器错误,但没有任何错误日志,无论是在/var/log/nginx/error.log还是在/var/log/php7.0-fpm.log

即使没有access.log在nginx中登录。

这是我的站点可用/默认的完整服务器块

# Default server configuration
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index test.php index.html index.htm index.nginx-debian.html;

    server_name tasks.siteflu.com;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;

        # With php7.0-cgi alone:
    #   fastcgi_pass 127.0.0.1:9000;
        # With php7.0-fpm:
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
        deny all;
    }
}

我尝试了网络上几乎所有可用的资源,但仍然无法使其工作。

另外,如果我指定一个 php 文件,比如test.php,作为索引,它会在打开时执行mydomain.com

但对于相同的文件 mydomain.com/test.php,我收到一个内部服务器错误,但没有任何日志记录。

相关内容