Skip to content

Instantly share code, notes, and snippets.

@chanmix51
Created August 17, 2011 08:45
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save chanmix51/1151113 to your computer and use it in GitHub Desktop.
Save chanmix51/1151113 to your computer and use it in GitHub Desktop.
nginx vhost conf silex & symfony
server {
listen 80;
server_name server.mydomain.net
root /var/www/app/web;
index index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location / {
if (-f $request_filename) {
expires max;
break;
}
rewrite ^(.*) /index.php last;
}
}
@gplessis
Copy link

To avoid the IP stack usage, you can use an Unix socket instead :

fastcgi_pass   unix:/var/run/php5-fpm.sock;

Here is the corresponding listen directive in your PHP-FPM pool's config :

listen = /var/run/php5-fpm.sock

@domnuprofesor
Copy link

what about the static content in /web folder? (js, css, image files and so on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment