This repository has been archived by the owner on May 6, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update robots.txt.j2 to accept Allow rule and multiple values
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
playbooks/roles/nginx/templates/edx/app/nginx/robots.txt.j2
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,28 @@ | ||
{% for item in NGINX_ROBOT_RULES %} | ||
{% if item.agent is string %} | ||
User-agent: {{ item.agent }} | ||
{% else %} | ||
{% for agent in item.agent %} | ||
User-agent: {{ agent }} | ||
{% endfor %} | ||
{% endif %} | ||
{% if item.allow is defined %} | ||
{% if item.allow is string %} | ||
Allow: {{ item.allow }} | ||
{% else %} | ||
{% for allow in item.allow %} | ||
Allow: {{ allow }} | ||
{% endfor %} | ||
{% endif %} | ||
{% endif %} | ||
{% if item.disallow is defined %} | ||
{% if item.disallow is string %} | ||
Disallow: {{ item.disallow }} | ||
{% else %} | ||
{% for disallow in item.disallow %} | ||
Disallow: {{ disallow }} | ||
{% endfor %} | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% endfor %} |