【发布时间】:2014-09-04 16:09:34
【问题描述】:
我在使用 nginx 配置 Symfony2 时遇到问题
我是这样安装symfony2的
php composer.phar create-project symfony/framework-standard-edition /var/www/symf
一切都很顺利,当我在配置页面上时没有错误
但是当我点击在线配置或 Buypass 配置时,我登陆 nginx 404 NOT FOUND
这里是配置文件
upstream phpfcgi {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name localhost;
root /var/www/symf/web;
error_log /var/log/nginx/symfony2.error.log;
access_log /var/log/nginx/symfony2.access.log;
# strip app.php/ prefix if it is present
rewrite ^/app\.php/?(.*)$ /$1 permanent;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass phpfcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
注意:我注意到当我点击 buypass 时,我登陆了一个类似 ....symf/web/app_dev.php/ 的链接 删除最后/允许我到达页面但得到和错误 点击确定 -> 404 未找到
我错过了什么?
parameters.yml
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root
database_password: *****
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: fr
secret: ******
debug_toolbar: true
debug_redirects: false
use_assetic_controller: true
【问题讨论】: