mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
Changeis for proxy_protocol and apply default values
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
{% set site = nginx_sites | nginx_search_by_ssl_name(item.name) %}
|
||||
{% set __listen = site.listen | default(['80', '[::]:80']) %}
|
||||
{% set __http_proxy_protocol_port = site.http_proxy_protocol_port | default([]) %}
|
||||
{% set __listen = item.listen | default(nginx_default_listen) %}
|
||||
{% set __listen_proxy_protocol = item.listen_proxy_protocol | default(nginx_default_listen_proxy_protocol) %}
|
||||
|
||||
server {
|
||||
{% for port in __listen %}
|
||||
listen {{ port }};
|
||||
{% endfor %}
|
||||
{% for port in __http_proxy_protocol_port %}
|
||||
{% for port in __listen_proxy_protocol %}
|
||||
listen {{ port }} proxy_protocol;
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{% set __proto = item.proto | default(['http']) %}
|
||||
{% set __main_name = item | nginx_site_name %}
|
||||
{% set __listen = item.listen | default(['80', '[::]:80']) %}
|
||||
{% set __listen_ssl = item.listen_ssl | default(['443', '[::]:443']) %}
|
||||
{% set __http_proxy_protocol_port = item.http_proxy_protocol_port | default([]) %}
|
||||
{% set __https_proxy_protocol_port = item.https_proxy_protocol_port | default([]) %}
|
||||
{% set __listen = item.listen | default(nginx_default_listen) %}
|
||||
{% set __listen_ssl = item.listen_ssl | default(nginx_default_listen_ssl) %}
|
||||
{% set __listen_proxy_protocol = item.listen_proxy_protocol | default(nginx_default_listen_proxy_protocol) %}
|
||||
{% set __listen_proxy_protocol_ssl = item.listen_proxy_protocol_ssl | default(nginx_default_listen_proxy_protocol_ssl) %}
|
||||
{% set __location = item.location | default({}) %}
|
||||
{% set __location_before = item.location_before | default({}) %}
|
||||
{% set __headers = item.headers | default(nginx_servers_default_headers) %}
|
||||
@@ -53,7 +53,7 @@ server {
|
||||
{% for port in __listen %}
|
||||
listen {{ port }};
|
||||
{% endfor %}
|
||||
{% for port in __http_proxy_protocol_port %}
|
||||
{% for port in __listen_proxy_protocol %}
|
||||
listen {{ port }} proxy_protocol;
|
||||
{% endfor %}
|
||||
server_name {{ server_name(name) }};
|
||||
@@ -75,7 +75,7 @@ server {
|
||||
{% for port in __listen %}
|
||||
listen {{ port }}{% if nginx_default_site == __main_name %} default_server{% endif %};
|
||||
{% endfor %}
|
||||
{% for port in __http_proxy_protocol_port %}
|
||||
{% for port in __listen_proxy_protocol %}
|
||||
listen {{ port }}{% if nginx_default_site == __main_name %} default_server{% endif %} proxy_protocol;
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
@@ -83,7 +83,7 @@ server {
|
||||
{% for port in __listen_ssl %}
|
||||
listen {{ port }}{% if nginx_default_site_ssl == __main_name %} default_server{% endif %} ssl{% if __http2 %} http2{% endif %};
|
||||
{% endfor %}
|
||||
{% for port in __https_proxy_protocol_port %}
|
||||
{% for port in __listen_proxy_protocol_ssl %}
|
||||
listen {{ port }}{% if nginx_default_site_ssl == __main_name %} default_server{% endif %} ssl{% if __http2 %} http2{% endif %} proxy_protocol;
|
||||
{% endfor %}
|
||||
{{ ssl(__ssl_name) }}
|
||||
@@ -196,7 +196,7 @@ server {
|
||||
{% for port in __listen %}
|
||||
listen {{ port }};
|
||||
{% endfor %}
|
||||
{% for port in __http_proxy_protocol_port %}
|
||||
{% for port in __listen_proxy_protocol %}
|
||||
listen {{ port }} proxy_protocol;
|
||||
{% endfor %}
|
||||
|
||||
@@ -211,7 +211,7 @@ server {
|
||||
{% for port in __listen_ssl %}
|
||||
listen {{ port }}{% if nginx_default_site_ssl == __main_name %} default_server{% endif %} ssl{% if __http2 %} http2{% endif %};
|
||||
{% endfor %}
|
||||
{% for port in __https_proxy_protocol_port %}
|
||||
{% for port in __listen_proxy_protocol_ssl %}
|
||||
listen {{ port }}{% if nginx_default_site_ssl == __main_name %} default_server{% endif %} ssl{% if __http2 %} http2{% endif %} proxy_protocol;
|
||||
{% endfor %}
|
||||
{{ ssl(__ssl_name) }}
|
||||
|
||||
Reference in New Issue
Block a user