Skip to content
Snippets Groups Projects
Commit 59e0dcfd authored by jurgenhaas's avatar jurgenhaas
Browse files

Support redirects by Apache for Drupal sites if no proxy is available

parent 047a55a0
Branches
No related tags found
No related merge requests found
......@@ -120,3 +120,23 @@
{% endif %}
{% endif %}
</VirtualHost>
{% if drupal_domain.redirects is defined and groups.proxyserver is not defined %}
<VirtualHost *:80>
Include /etc/apache2/{{ apache_conf_dir }}/global-redirect.conf
ServerAdmin {{ apache_server_admin }}
ServerName dummy.{{ drupal_domain.domain }}
ServerAlias {% for redirect in drupal_domain.redirects %} {{ redirect }}{% endfor %}
RewriteEngine on
RewriteRule ^ {{ drupal_domain.protocol|default("https") }}://{{ drupal_domain.domain }}%{REQUEST_URI} [END,QSA,R=permanent]
ErrorLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-error.log
LogLevel warn
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-access.log combined env=!forwarded
CustomLog {{ apacheLogDir }}/{{ drupal_domain.domain }}-access.log proxy env=forwarded
</VirtualHost>
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment