Created
October 12, 2013 15:58
-
-
Save sfelde/6951611 to your computer and use it in GitHub Desktop.
auth for subdomain
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
... | |
if ($host ~ "(beta|alpha).domain.com" ) { | |
return 555; | |
} | |
error_page 555 = @auth; | |
location @auth { | |
auth_basic "Restricted"; | |
auth_basic_user_file /home/..../.htpasswd; | |
try_files $uri @pages; | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment