Skip to content
Snippets Groups Projects
Commit 434224af authored by jurgenhaas's avatar jurgenhaas
Browse files

Implement support for trusted domains in Drupal, that won't get redirected like the aliases

parent 8f1e1a83
Branches
No related tags found
No related merge requests found
......@@ -47,6 +47,9 @@ $settings['trusted_host_patterns'] = array(
{% for alias in item.aliases|default([]) %}
'^{{ alias|regex_escape() }}$',
{% endfor %}
{% for trusted_domain in item.trusted_domains|default([]) %}
'^{{ trusted_domain|regex_escape() }}$',
{% endfor %}
);
$config['system.file']['path']['temporary'] = '{% if drupal.jail is defined %}{{ jailroot }}/{{ drupal.jail.name }}{% endif %}/tmp';
......
......@@ -6,6 +6,9 @@ $sites = array(
{% for alias in drupaldomain.aliases|default([]) %}
'{{ alias }}' => '{{ drupaldomain.shortname|default("default") }}',
{% endfor %}
{% for trusted_domain in drupaldomain.trusted_domains|default([]) %}
'{{ trusted_domain }}' => '{{ drupaldomain.shortname|default("default") }}',
{% endfor %}
{% endfor %}
//[NEXT]
);
......@@ -5,7 +5,7 @@
ServerAdmin {{ apache_server_admin }}
ServerName {{ drupal_domain.domain }}
{% if not drupal_domain.aliases_redirect|default(False) %}
ServerAlias {{ drupal_domain.domain }}{% for alias in drupal_domain.aliases|default([]) %} {{ alias }}{% endfor %}
ServerAlias {{ drupal_domain.domain }}{% for alias in drupal_domain.aliases|default([]) %} {{ alias }}{% endfor %}{% for trusted_domain in drupal_domain.trusted_domains|default([]) %} {{ trusted_domain }}{% endfor %}
{% endif %}
RewriteEngine on
......@@ -26,7 +26,7 @@
ServerAdmin {{ apache_server_admin }}
ServerName {{ drupal_domain.domain }}
{% if not drupal_domain.aliases_redirect|default(False) %}
ServerAlias {{ drupal_domain.domain }}{% for alias in drupal_domain.aliases|default([]) %} {{ alias }}{% endfor %}
ServerAlias {{ drupal_domain.domain }}{% for alias in drupal_domain.aliases|default([]) %} {{ alias }}{% endfor %}{% for trusted_domain in drupal_domain.trusted_domains|default([]) %} {{ trusted_domain }}{% endfor %}
{% endif %}
{% if drupal.jail is defined %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment