r_nbuw
Last Updated: February 25, 2016
·
2.809K
· tixastronauta
1203295710 f

Setting Nginx for Symfony 1.4 projects

I’ve been trying out nginx server for symfony 1.4 applications, the configuration can be a little bit tricky though… Here’s a working example:

server {
  listen 80;

  server_name yourdomain.com www.yourdomain.com;

  root /var/www/yourdomain.com/httpdocs/web;

  access_log /var/www/yourdomain.com/logs/access_log main;
  error_log /var/www/yourdomain.com/logs/error_log;

  index index.php;

  location / {
    try_files $uri $uri/ /index.php$uri?$args;
  }

  location ~ "^(.+\.php)($|/)" {
        fastcgi_split_path_info ^(.+\.php)(.*)$;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass   127.0.0.1:9000;
        include        fastcgi_params;
    }

}
Say Thanks
Respond

1 Response
Add your response

18824
0 kmzyhnt5p7llupwotuvfhqkhxf5k2p4otj3ihztv8wl81cfepxlkqv6ulgl77nj6lsccftupbojn

Great you save my life

over 1 year ago ·