新的symfony2安装/config.php";工作,只是/&引用;返回:哎呀!发生错误;服务器返回一个";404找不到;。?

新的symfony2安装/config.php";工作,只是/&引用;返回:哎呀!发生错误;服务器返回一个";404找不到;。?,symfony,nginx,php,symfony-2.6,Symfony,Nginx,Php,Symfony 2.6,我为我的所有站点运行nginx+php fpm。有些是drupal,有些是独立的,有些也使用清漆。一切都很好 我正在安装第一个symfony2站点——没有清漆,只有nginx 安装symfony后 ✔ Symfony 2.6.5 was successfully installed. Now you can: 我首先检查php web服务器 cd ./symfony php app/console server:run @导航至: http://127.0.0.1:8000 http:

我为我的所有站点运行nginx+php fpm。有些是drupal,有些是独立的,有些也使用清漆。一切都很好

我正在安装第一个symfony2站点——没有清漆,只有nginx

安装symfony后

 ✔  Symfony 2.6.5 was successfully installed. Now you can:
我首先检查php web服务器

cd ./symfony
php app/console server:run
@导航至:

http://127.0.0.1:8000
http://127.0.0.1:8000/config.php
https://symfony.lan/test.txt
我明白了

&@nav to:

http://127.0.0.1:8000/config.php
我明白了

接下来,我切换到nginx配置

测试非php

echo blah > web/test.txt
@导航至:

http://127.0.0.1:8000
http://127.0.0.1:8000/config.php
https://symfony.lan/test.txt
我明白了

接下来,我添加了web/config.php

...
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
    '127.0.0.1',
    '::1',
+    '192.168.1.10',
+    '2001:xxx:xxxx:xxx::10'  
))) {
    header('HTTP/1.0 403 Forbidden');
    exit('This script is only accessible from localhost.');
}
...
如果我导航到:

https://symfony.lan/config.php
我进入浏览器

==> "Symfony - Welcome"
Oops! An Error Occurred
The server returned a "404 Not Found".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused. 
但是@nav只是:

https://symfony.lan
我进入浏览器

==> "Symfony - Welcome"
Oops! An Error Occurred
The server returned a "404 Not Found".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused. 
在我的日志中

==> /var/log/nginx/symfony.access.log <==
2001:xxx:xxxx:xxx::10 - - [23/Mar/2015:07:38:04 -0700] GET / HTTP/1.1 "404" 288 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0" "-"
我的nginx配置基本上是一字不差的

server {
    server_name www.symfony.lan;
    return 301 $scheme://symfony.lan$request_uri;
}

server {
    server_name symfony.lan;
    listen [2001:xxx:xxxx:xxx::10]:80;
    listen 192.168.1.10:80;
    rewrite ^(.*) https://symfony.lan$1 permanent;
    break;
}

server {
    server_name symfony.lan;
    listen [2001:xxx:xxxx:xxx::10]:443 ssl spdy;
    listen 192.168.1.10:443 ssl spdy;

    root        /svr/www/symfony.lan/symfony/web;
    access_log  /var/log/nginx/symfony.access.log   main;
    error_log   /var/log/nginx/symfony.error.log    info;
    rewrite_log off;
    autoindex  on;

    ssl on;
    include ssl.conf;
    ssl_verify_client off;
    ssl_certificate "ssldir/symfony.lan.crt";
    ssl_trusted_certificate "ssldir/symfony.lan.crt";
    ssl_certificate_key "ssldir/symfony.lan.key";

    add_header Strict-Transport-Security "max-age=315360000; includeSubdomains";
    add_header X-Frame-Options DENY;

    rewrite ^/app\.php/?(.*)$ /$1 permanent;

    location / {
        index app.php;
        try_files $uri @rewriteapp;
    }

    location @rewriteapp {
        rewrite ^(.*)$ /app.php/$1 last;
    }

    location ~ ^/(app|app_dev|config)\.php(/|$) {
        fastcgi_pass phpfpm;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS on;
    }

}
尽管在其他文章中作为可能的修复被引用,但执行@web root

php app/console cache:clear  --env=prod
php app/console cache:warmup --env=prod
这里什么都不修

这是Symony或Nginx、my config或应用程序的问题吗


为了使第一页正常工作,我具体需要做哪些更改

试试
https://symfony.lan/app_dev.php
。也许您会看到错误原因或查看Symfony日志。/app_dev.php工作正常——显示“欢迎”屏幕。OTOH,/app.php404s。查看app/logs/prod.log。应该有404页的原因。