Skip to content

Instantly share code, notes, and snippets.

@dgoujard
Created September 11, 2011 21:03
Show Gist options
  • Save dgoujard/1210124 to your computer and use it in GitHub Desktop.
Save dgoujard/1210124 to your computer and use it in GitHub Desktop.
/etc/nginx/site-enabled/default
server {
listen 80;
location / {
root html;
index index.php index.html;
if (-f $request_filename) {
access_log off;
expires max;
}
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
}
upstream backend {
server unix:/var/run/php-fpm/php-fpm.sock;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment