Skip to content

Instantly share code, notes, and snippets.

@wicochandra
Created October 6, 2015 08:41
Show Gist options
  • Save wicochandra/2bcf3d8b760b94d35e19 to your computer and use it in GitHub Desktop.
Save wicochandra/2bcf3d8b760b94d35e19 to your computer and use it in GitHub Desktop.
Nginx Dynamic Project configuration
server {
listen 80;
set $project_dir /home/wico/Projects;
server_name ~^(?<project>.+)\.lvh\.me$;
index index.php index.html index.htm;
root $project_dir/$project/public;
client_max_body_size 1G;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ ^/(_front-end|_frontend)\/? {
root $project_dir/$project/;
autoindex on;
index _;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_read_timeout 600;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param PHP_VALUE "upload_max_filesize=1G
post_max_size=1G";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment