Welcome! Log In Create A New Profile

Advanced

nginx symfony2 configuration

Pascal Christen
March 02, 2015 11:50AM
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
$document_root$fastcgi_script_name;

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

fastcgi_param PATH_INFO $fastcgi_path_info;

fastcgi_param PATH_TRANSLATED
$document_root$fastcgi_path_info;

fastcgi_pass 127.0.0.1:9000;

fastcgi_read_timeout 50000;

}

}

}

}
----

What I'm doing wrong?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx symfony2 configuration

Pascal Christen March 02, 2015 11:50AM

Re: nginx symfony2 configuration

Francis Daly March 02, 2015 02:52PM

Re: nginx symfony2 configuration

Pascal Christen March 02, 2015 03:50PM

Re: nginx symfony2 configuration

Francis Daly March 02, 2015 05:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready