Use global variables
This commit is contained in:
parent
63d5eabd20
commit
a809600237
@ -2,8 +2,8 @@
|
|||||||
{{ before_server }}
|
{{ before_server }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
server {
|
server {
|
||||||
{% if listen80 is defined -%}
|
{% if nginx_listen80 is defined -%}
|
||||||
{{ listen80 }}
|
{{ nginx_listen80 }}
|
||||||
{% else %}
|
{% else %}
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
@ -32,8 +32,8 @@ server {
|
|||||||
{{ unsecure_server }}
|
{{ unsecure_server }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
location /.well-known/acme-challenge {
|
location /.well-known/acme-challenge {
|
||||||
{% if acme_challenge is defined %}
|
{% if nginx_acme_challenge is defined %}
|
||||||
{{ acme_challenge }}
|
{{ nginx_acme_challenge }}
|
||||||
{% else %}
|
{% else %}
|
||||||
root /var/www/acme;
|
root /var/www/acme;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -41,10 +41,10 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
{% if listen443 is defined -%}
|
{% if nginx_listen443 is defined -%}
|
||||||
{{ listen443 }}
|
{{ nginx_listen443 }}
|
||||||
{% else %}
|
{% else %}
|
||||||
listen {% if ansible_hostname is defined and ansible_hostname == 'ouaset' %}unix:/var/run/nginx-https.sock{% else %}443{% endif %} ssl http2;
|
listen 443 ssl http2;
|
||||||
listen [::]:443 ssl http2;
|
listen [::]:443 ssl http2;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
server_name {% if redirect_to_first is not defined or not redirect_to_first %}{{ domains | join(' ') }}{% else %}{{ domains[0] }}{% endif %};
|
server_name {% if redirect_to_first is not defined or not redirect_to_first %}{{ domains | join(' ') }}{% else %}{{ domains[0] }}{% endif %};
|
||||||
@ -80,8 +80,12 @@ server {
|
|||||||
}
|
}
|
||||||
{% if redirect_to_first is defined and redirect_to_first and domains|length > 1 %}
|
{% if redirect_to_first is defined and redirect_to_first and domains|length > 1 %}
|
||||||
server {
|
server {
|
||||||
listen {% if ansible_hostname is defined and ansible_hostname == 'ouaset' %}unix:/var/run/nginx-https.sock{% else %}443{% endif %} ssl http2;
|
{% if nginx_listen443 is defined -%}
|
||||||
|
{{ nginx_listen443 }}
|
||||||
|
{% else %}
|
||||||
|
listen 443 ssl http2;
|
||||||
listen [::]:443 ssl http2;
|
listen [::]:443 ssl http2;
|
||||||
|
{% endif %}
|
||||||
server_name {{ domains[1:] | join(' ') }};
|
server_name {{ domains[1:] | join(' ') }};
|
||||||
{% if proxy_protocol is defined %}
|
{% if proxy_protocol is defined %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user