-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't block requests coming from localhost. We want our cron cURL job…
…s to still work.
- Loading branch information
1 parent
c46939d
commit 40383fe
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# {{ ansible_managed }} | ||
# Keep search engines out of all sites on the server. | ||
# To disable for a specific site or location block, add "auth_basic off;" to your config. | ||
auth_basic "{{ nginx_auth_basic_realm }}"; | ||
# Require basic auth to keep snoopy search engines out of all sites on the server, | ||
# adding an exception map so we don't block requests originating from localhost. We want our cron cURL jobs to still work. | ||
# To disable basic auth for a specific site or location block, add "auth_basic off;" to your config. | ||
|
||
map $remote_addr $auth_basic_flag { | ||
"127.0.0.1" "off"; | ||
default "{{ nginx_auth_basic_realm }}"; | ||
} | ||
|
||
auth_basic $auth_basic_flag; | ||
auth_basic_user_file {{ nginx_auth_basic_db_path }}; |