Also check notls variable state
This commit is contained in:
parent
b247b39785
commit
41f04835de
@ -24,7 +24,7 @@ server {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
server_name {{ domains | join(' ') }};
|
server_name {{ domains | join(' ') }};
|
||||||
|
|
||||||
{%+ if notls is not defined and unsecure_server is not defined %}
|
{%+ if (notls is not defined or not notls) and unsecure_server is not defined %}
|
||||||
location / {
|
location / {
|
||||||
# enforce https
|
# enforce https
|
||||||
return 301 https://$server_name:443$request_uri;
|
return 301 https://$server_name:443$request_uri;
|
||||||
@ -40,7 +40,7 @@ server {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{%+ if notls is not defined %}
|
{%+ if notls is not defined or not notls %}
|
||||||
server {
|
server {
|
||||||
{% if nginx_listen443 is defined %}
|
{% if nginx_listen443 is defined %}
|
||||||
{{ nginx_listen443 }}
|
{{ nginx_listen443 }}
|
||||||
@ -81,6 +81,7 @@ ssl_certificate /etc/ssl/csr/{{ domains[0] }}-fullchain.crt;
|
|||||||
{% if server -%}
|
{% if server -%}
|
||||||
{{ server | indent(4) }}
|
{{ server | indent(4) }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{% if server2 is defined -%}
|
{% if server2 is defined -%}
|
||||||
{{ server2 | indent(4) }}
|
{{ server2 | indent(4) }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user