Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

BB-749 Update robots.txt.j2 to accept Allow rule and multiple values #4942

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,10 @@
- Role: nginx
- Modified robots.txt.j2 to accept the Allow rule.
- Modified robots.txt.j2 to accept either a single string or a list of strings for agent, disallow, and allow.

- Role: ecommerce
- Added CORS_ORIGIN_WHITELIST and CORS_URLS_REGEX to allow selective CORS whitelisting of origins/urls.

- common_vars
- Added new overridable variable `COMMON_LMS_BASE_URL`.

Expand Down
23 changes: 23 additions & 0 deletions playbooks/roles/nginx/templates/edx/app/nginx/robots.txt.j2
@@ -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 %}