Skip to content

Instantly share code, notes, and snippets.

@shmaltorhbooks
Created April 14, 2015 07:37
Show Gist options
  • Select an option

  • Save shmaltorhbooks/8f9e2a7eca741ba2337c to your computer and use it in GitHub Desktop.

Select an option

Save shmaltorhbooks/8f9e2a7eca741ba2337c to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name ~^(www\.)?(?<sname>.+?).local.com$;
root /var/www/$sname/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }
access_log /var/log/nginx/$sname-access.log;
error_log  /var/log/nginx/wildcard-error.log debug;
error_page 404 /index.php;
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment