diff -r 7d06fc8ea782 -r 31b1b24e105c {{cookiecutter.project_slug}}/etc/apache2.4/{{cookiecutter.project_slug}}.conf --- a/{{cookiecutter.project_slug}}/etc/apache2.4/{{cookiecutter.project_slug}}.conf Wed Nov 21 09:40:36 2018 +0100 +++ b/{{cookiecutter.project_slug}}/etc/apache2.4/{{cookiecutter.project_slug}}.conf Thu Dec 27 13:13:47 2018 +0100 @@ -5,6 +5,19 @@ ServerAdmin webmaster@localhost ServerName {{ cookiecutter.virtual_hostname }} +{%- if cookiecutter.use_https.lower() in ('true','on','yes','1') %} + + RewriteEngine on + RewriteRule (.*) https://{{ cookiecutter.virtual_hostname}}$1 + + + + + + ServerAdmin webmaster@localhost + ServerName {{ cookiecutter.virtual_hostname }} +{%- endif %} + DocumentRoot $((INSTALL))/var/htdocs ErrorLog {{ cookiecutter.logs_directory }}/{{ cookiecutter.project_slug }}-error.log @@ -26,4 +39,23 @@ Require all granted +{%- if cookiecutter.use_notifications.lower() in ('true','on','yes','1') %} + + RewriteEngine on + + RewriteCond %{HTTP:Upgrade} =websocket [NC] + RewriteRule /(.*) ws://{{ cookiecutter.pyams_ws_notify }}/$1 [P,L] +{%- endif %} + +{%- if cookiecutter.use_https.lower() in ('true','on','yes','1') %} + + SSLEngine on +{%- if cookiecutter.use_notifications.lower() in ('true','on','yes','1') %} + SSLProxyEngine on +{%- endif %} + + SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem + SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key +{%- endif %} +