blob: bd63a7772bd91c8901e045c73331e92d50a99489 [file] [log] [blame]
{%- set site = salt['pillar.get']('apache:server:site:'+site_name) %}
<VirtualHost *:{% if site.host.port is defined %}{{ site.host.port }}{% else %}{% if site.ssl is defined %}443{% else %}80{% endif %}{% endif %}>
{%- include "apache/files/_name.conf" %}
{%- include "apache/files/_ssl.conf" %}
{%- include "apache/files/_log.conf" %}
DocumentRoot /var/www
{%- if site.proxy.get('initial_pooled', True) == False %}
SetEnv proxy-initial-not-pooled 1
{%- endif %}
ProxyPass / {{ site.proxy.protocol }}://{{ site.proxy.host }}:{{ site.proxy.port }}/{% if site.proxy.get('nocanon', False)%} nocanon{% endif %}
{%- if site.proxy.preservehost is defined %}
ProxyPreserveHost {% if site.proxy.preservehost %}On{% else %}Off{% endif %}
{%- endif %}
{%- if site.get('ssl', {'enabled': False}).get('enabled', False) %}
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set Front-End-Https "On"
{%- endif %}
<Location / >
{%- if site.auth is defined%}
{%- set auth = site.auth %}
{%- include "apache/files/_auth.conf" %}
{%- endif %}
ProxyPassReverse {{ site.proxy.protocol }}://{{ site.proxy.host }}:{{ site.proxy.port }}/
<Limit OPTIONS PROPFIND GET REPORT MKACTIVITY PROPPATCH PUT CHECKOUT MKCOL MOVE COPY DELETE LOCK UNLOCK MERGE>
Order Deny,Allow
Allow from all
</Limit>
</Location>
{%- include "apache/files/_locations.conf" %}
</VirtualHost>