nginx symfony2 configuration

Pascal Christen tronje85 at
Mon Mar 2 16:48:31 UTC 2015

I'm trying to set up an nginx webserver for website that uses angularjs for
the frontend and symfony2 for backend stuff. I'm having trouble to set up
nginx for symfony (the angular configuration works fine). If I navigate in
browser to : http://localhost:9090/backend/app_dev.php/, I get a 404 Error
from nginx..

here is my configuration file for nginx:

worker_processes  1;

error_log  /usr/local/etc/nginx/logs/error.log;

events {

    worker_connections  1024;


http {

    include       mime.types;

    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  200;

    gzip  on;

    server {

       listen       9090;

       server_name  localhost;

       #angular app

       location / {

           root   /Users/test/myproject/client/;

           index  index.html index.htm;


       #symfony backend

       location /backend {

           alias   /Users/test/myproject/backend/web;

           location ~ ^/(app|app_dev)\.php(/|$) {

               include fastcgi_params;

               fastcgi_param   SCRIPT_FILENAME

               fastcgi_split_path_info ^(.+\.php)(/.*)$;

               fastcgi_param PATH_INFO $fastcgi_path_info;

               fastcgi_param PATH_TRANSLATED


               fastcgi_read_timeout 50000;





What I'm doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list