Skip to content

Instantly share code, notes, and snippets.

@alOneh
Created November 6, 2014 13:45
Show Gist options
  • Save alOneh/c73de6c7baedb61d5c34 to your computer and use it in GitHub Desktop.
Save alOneh/c73de6c7baedb61d5c34 to your computer and use it in GitHub Desktop.
Symfony 1.4 Nginx configuration
server {
listen 80;
root /var/www/example.com/web;
index index.php;
server_name example.com.dev;
access_log /var/log/nginx/$host.access.log;
error_log /var/log/nginx/$host.error.log;
charset utf-8;
location / {
if (-f $request_filename) {
expires max;
break;
}
if ($request_filename !~ "\.(js|htc|ico|gif|jpg|png|css)$") {
rewrite ^(.*) /index.php last;
}
}
location ^~ /sf/ {
root /var/www/example.com/lib/vendor/symfony/data/web/;
}
location ~ \.php($|/) {
include fastcgi_params;
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment