nginx: [emerg] open() "/etc/nginx/fastcgi.conf" failed

版权声明:本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可,转载时请标注 https://blog.csdn.net/qq6759/article/details/88564345

nginx: [emerg] open() "/etc/nginx/fastcgi.conf" failed (2: No such file or directory) in

nginx -t

报这个错误,仔细检查发现 nginx/1.14.2 版本的 fastcgi.conf 文件不见了 变成了 fastcgi_params

include fastcgi.conf;

查看官方文档示例,果然:

server {
    listen      80;
    server_name example.org www.example.org;
    root        /data/www;

    location / {
        index   index.html index.php;
    }

    location ~* \.(gif|jpg|png)$ {
        expires 30d;
    }

    location ~ \.php$ {
        fastcgi_pass  localhost:9000;
        fastcgi_param SCRIPT_FILENAME
                      $document_root$fastcgi_script_name;
        include       fastcgi_params;
    }
}

nginx version: nginx/1.14.2

猜你喜欢

转载自blog.csdn.net/qq6759/article/details/88564345