Add support for name based virtual hostsmaster
Listen 443 | Listen 443 | ||||
</IfModule> | </IfModule> | ||||
{%- endif %} | {%- endif %} | ||||
{%- if salt['pillar.get']('apache:name_virtual_hosts') is iterable %} | |||||
{%- set name_virtual_host_directives = [] %} | |||||
{%- for name_virtual_host in salt['pillar.get']('apache:name_virtual_hosts') %} | |||||
{%- set interface = name_virtual_host.get('interface', '*') %} | |||||
{%- set port = name_virtual_host.get('port', 80) %} | |||||
{%- set name_virtual_host_directive = interface ~ ':' ~ port %} | |||||
{%- do name_virtual_host_directives.append(name_virtual_host_directive) %} | |||||
{%- endfor %} | |||||
{%- for name_virtual_host in name_virtual_host_directives %} | |||||
NameVirtualHost {{ name_virtual_host }} | |||||
{%- endfor %} | |||||
{%- endif -%} |
Listen 443 | Listen 443 | ||||
</IfModule> | </IfModule> | ||||
{%- endif %} | {%- endif %} | ||||
{%- if salt['pillar.get']('apache:name_virtual_hosts') is iterable %} | |||||
{%- set name_virtual_host_directives = [] %} | |||||
{%- for name_virtual_host in salt['pillar.get']('apache:name_virtual_hosts') %} | |||||
{%- set interface = name_virtual_host.get('interface', '*') %} | |||||
{%- set port = name_virtual_host.get('port', 80) %} | |||||
{%- set name_virtual_host_directive = interface ~ ':' ~ port %} | |||||
{%- do name_virtual_host_directives.append(name_virtual_host_directive) %} | |||||
{%- endfor %} | |||||
{%- for name_virtual_host in name_virtual_host_directives %} | |||||
NameVirtualHost {{ name_virtual_host }} | |||||
{%- endfor %} | |||||
{%- endif -%} |
AllowEncodedSlashes: "On" | AllowEncodedSlashes: "On" | ||||
name_virtual_hosts: | |||||
- interface: * | |||||
port: 80 | |||||
- interface: * | |||||
port: 443 | |||||
# ``apache.vhosts`` formula additional configuration: | # ``apache.vhosts`` formula additional configuration: | ||||
sites: | sites: | ||||
example.net: | example.net: |