Skip to content

Instantly share code, notes, and snippets.

@jyunderwood
Created April 1, 2013 21:07
Show Gist options
  • Save jyunderwood/5287771 to your computer and use it in GitHub Desktop.
Save jyunderwood/5287771 to your computer and use it in GitHub Desktop.
Serving PHP with Nginx and PHP-FPM
server {
listen 80;
server_name example.com;
root /home/deploy/apps/example.com/public;
index index.html index.php;
client_max_body_size 1G;
fastcgi_buffers 64 4K;
location / {
try_files $uri $uri/ index.php;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment