nGinx 在引用路由时抛出内部服务器错误

标签 nginx centos symfony php-7

刚刚在 CentOS 7 上安装了 LEMP 堆栈,其中包括 PHP 7..
我上传了 Symfony 3 项目,我的问题是,当我尝试访问路由时,它只显示内部服务器错误,例如:当我被重定向到 /login通过 fos_user_bundle有那个内部服务器错误。
我查看了错误日志,它们看起来像这样: 2017/02/08 11:51:35 [error] 488#0: *1 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: <ip address>, server: mydomain.ge, request: "GET /foldername/web/app_dev.php/login HTTP/1.1", host: "mydomain.ge"

server {
    listen   80;

    root /var/www/html;
    index index.php index.html index.htm;
    server_name  mydomain.ge <server ip address>;

    location / {
        try_files $uri $uri/ /index.html;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/www;
    }

    location ~ .php$ {
        try_files $uri =404;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

我的配置文件(example.conf)看起来像上面这样。

有任何想法吗?

最佳答案

如果你想要/loginindex.php 处理您需要添加 index.php到试用文件。

try_files $uri $uri/ /index.php;

关于nGinx 在引用路由时抛出内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42112950/

相关文章:

linux - Google Chrome 中的 ERR_INVALID_SIGNED_EXCHANGE 错误

linux - 定位共享库 libOS.so

symfony - 如何使用 Symfony2 中的 FormBuilder 将表单的 url 设置为 POST?

Symfony3 工厂即服务

java - 重写规则附加 webapp 上下文路径与 <spring :url> and <c:url> taglibs 冲突

ruby-on-rails - Rails API 404 错误 - 使用 Capistrano、Nginx 和 Passenger 部署

django - 帮助我配置nginx-varnish-uwsgi-django

linux - puppet 覆盖模块上的文件资源

centos - 来电失败 Asterisk

php - 在数据库中保存数据时,Doctrine 将 UTF8 编码更改为 html 实体