-
-
Save boywhoroared/1172b8ef60b4d218898a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| index index.php; | |
| set $basepath "/var/www"; | |
| set $domain $host; | |
| if ($domain ~ "^(.[^.]*)\.dev$") { | |
| set $domain $1; | |
| set $rootpath "${domain}"; | |
| set $servername "${domain}.dev"; | |
| } | |
| if ($domain ~ "^(.*)\.(.[^.]*)\.dev$") { | |
| set $subdomain $1; | |
| set $domain $2; | |
| set $rootpath "${domain}/${subdomain}/www/"; | |
| set $servername "${subdomain}.${domain}.dev"; | |
| } | |
| server_name $servername; | |
| root $basepath/$rootpath; | |
| location / { | |
| try_files $uri $uri/ /index.php?$args; | |
| } | |
| location ~ \.php$ { | |
| try_files $uri =404; | |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
| fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| fastcgi_index index.php; | |
| include fastcgi_params; | |
| } | |
| location ~ /\.ht { | |
| deny all; | |
| } | |
| location ~ /\.git { | |
| deny all; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment