diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index bfd34e4..76ff26a 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -24,10 +24,12 @@ server { {% endif %} server_name {{ domains | join(' ') }}; +{%+ if notls is not defined and unsecure_server is not defined %} location / { # enforce https return 301 https://$server_name:443$request_uri; } +{% endif %} {% if unsecure_server is defined -%} {{ unsecure_server | indent(4) }} {%- endif %}