Last active
December 15, 2015 14:49
-
-
Save zaiste/5277618 to your computer and use it in GitHub Desktop.
This file contains 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
... | |
include sites-enabled/*.dev; | |
server { | |
listen 80; | |
server_name app localhost .dev; | |
set $basepath "/Users/zaiste/code"; | |
set $domain $host; | |
if ($domain ~ "^(.*)\.dev$") { | |
set $domain $1; | |
} | |
set $rootpath "${domain}"; | |
if (-d $basepath/$domain/public) { | |
set $rootpath "${domain}/public"; | |
} | |
if (-f $basepath/$domain/index.php) { | |
set $rootpath $domain; | |
} | |
if (-f $basepath/$domain/index.html) { | |
set $rootpath $domain; | |
} | |
root $basepath/$rootpath; | |
# redirect server error pages to the static page /50x.html | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment