Last active
August 29, 2015 14:25
-
-
Save Gems/fa8a40d6cc6d212ab586 to your computer and use it in GitHub Desktop.
Development environment
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
server { | |
listen 80; | |
server_name ~^(?<domain>.+)$; | |
set $htdocs "/usr/local/var/www/$domain/"; | |
root $htdocs; | |
index index.html; | |
set $auth "off"; | |
if (-f $htdocs/.htpasswd) { | |
set $auth "Restricted"; | |
} | |
auth_basic $auth; | |
auth_basic_user_file $htdocs/.htpasswd; | |
location ~(?<url>.+)\/$ { | |
try_files $url $url/ $url.html =404; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment