Symfony2 nginx问题 - 加载Web调试工具栏时未找到并发生所有页面404

时间:2014-12-27 11:43:28

标签: symfony nginx

当我试图在nginx上运行时,我的symfony2项目出现了问题。

www.domain /工作正常

www.domain / app_dev.php,"加载Web调试工具栏时出错(404:Not Found)。你想打开探查器吗?"

www.domain / app.php / someurl / - 404 not found

/etc/nginx/site-available/example.com

server {
    listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default ipv6only=on; ## listen for ipv6

    root /var/www/adwords-up;
    index app_dev.php;

    # Make site accessible from http://localhost/
    server_name adwords-up.test;

    location / {
       try_files $uri $uri/ =404;
    }

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

    location ~ \.php$ {
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass unix:/var/run/php5-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
    }

}

1 个答案:

答案 0 :(得分:0)

Symfony2 web目录是/ web,因此您应该尝试root /var/www/adwords-up/web