Skip to content

Instantly share code, notes, and snippets.

@Javlopez
Created September 7, 2012 22:32
Show Gist options
  • Save Javlopez/3670322 to your computer and use it in GitHub Desktop.
Save Javlopez/3670322 to your computer and use it in GitHub Desktop.
Nginx config with php-fpm
server {
listen 80;
server_name ~^app\.(.*)\.(.*)$;
if ($host ~ "^app\.(.*)\.(.*)") {
set $sub $1;
set $app_env $2;
}
access_log /www/logs/$sub.server.access.log;
error_log /www/logs/$sub.server.error.log;
gzip on;
gzip_min_length 1000;
gzip_types text/plain text/xml application/xml;
client_max_body_size 20m;
root "/www/$sub/public";
autoindex on;
location ~* ^.+\.(wsf|xml|pdf|doc|jpg|jpeg|gif|css|png|js|ico|ttf|eot|otf|svg)$ {
access_log off;
}
try_files $uri $uri/ /index.php?$args;
index index.html index.htm index.php;
location ~ \.php$ {
autoindex on;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 60000;
fastcgi_send_timeout 60000;
send_timeout 60000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param APPLICATION_ENV $app_env;
fastcgi_param HTTPS $https;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment