Skip to content

Instantly share code, notes, and snippets.

@dizda
Last active October 4, 2015 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dizda/2589229 to your computer and use it in GitHub Desktop.
Save dizda/2589229 to your computer and use it in GitHub Desktop.
sample configuration file of nginx for symfony2 project
server {
listen [::]:80;# to listenning both on IPv4 & IPv6
server_name dev.youserver.com;
location / {
root /opt/www/dev.yourserver.com/symfony/web;
index app.php;
if ($request_filename !~ "\.(htc|ico|gif|jpg|jpeg|png|css|js)$") {
rewrite ^(.*) /app.php$1 last;
}
}
location ~ \.php($|/) {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
#fastcgi_buffers 8 16k;
#fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME /opt/www/dev.yourserver.com/symfony/web$script;
fastcgi_param PATH_INFO $path_info;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment