Files
ansible_apache_vhost/templates/vhost.conf.jj

52 lines
1.5 KiB
Plaintext

<VirtualHost *:80>
Servername {{ apache_server_name }}
{% if apache_server_alias is defined %}
{%for alias in apache_server_alias %}
ServerAlias {{ alias }}
{%endfor%}
{%endif%}
DocumentRoot {{ apache_document_root }}
<Directory {{ apache_document_root }}>
require all granted
Options +indexes
</Directory>
{%if apache_use_ssl %}
<IfModule rewrite>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} "!^/\.well-known"
RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]
</IfModule>
{%endif %}
</VirtualHost>
{%if apache_use_ssl %}
<VirtualHost *:443>
Servername {{ apache_server_name }}
{% if apache_server_alias is defined %}
{%for alias in apache_server_alias %}
ServerAlias {{ alias }}
{%endfor%}
{%endif%}
Protocols h2 http/1.1
DocumentRoot {{ apache_document_root }}
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
SSLCertificateChainFile {{ apache_ssl_chain }}
SSLCertificateFile {{ apache_ssl_certificate }}
SSLCertificateKeyFile {{ apache_ssl_key }}
CustomLog {{ apache_access_log }} combined
DirectoryIndex index.php index.html
<Directory {{ apache_document_root }}>
require all granted
Options +Indexes
AllowOverride {{ apache_allowoverride }}
</Directory>
{%if apache_use_php %}
<FilesMatch \.php$>
SetHandler "{{ php_listen_url }}"
</FilesMatch>
{% endif %}
</VirtualHost>
{%endif %}