If nginx_listenXXX is present, don't write proxy_protocol stuff

This commit is contained in:
nemunaire 2023-04-16 00:27:13 +02:00
parent b4dd769d08
commit 2a388e7c48
1 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,6 @@ server {
{% else %}
listen 80;
listen [::]:80;
{% endif %}
{% if proxy_protocol is defined %}
listen 81 proxy_protocol;
@ -22,6 +21,7 @@ server {
port_in_redirect off;
{% endif %}
{% endif %}
server_name {{ domains | join(' ') }};
location / {
@ -45,8 +45,6 @@ server {
{% else %}
listen 443 ssl http2;
listen [::]:443 ssl http2;
{% endif %}
server_name {% if redirect_to_first is not defined or not redirect_to_first %}{{ domains | join(' ') }}{% else %}{{ domains[0] }}{% endif %};
{% if proxy_protocol is defined %}
listen 442 ssl http2 proxy_protocol;
@ -61,6 +59,8 @@ server {
port_in_redirect off;
{% endif %}
{% endif %}
server_name {% if redirect_to_first is not defined or not redirect_to_first %}{{ domains | join(' ') }}{% else %}{{ domains[0] }}{% endif %};
{% if ssl_certificate is defined -%}
{{ ssl_certificate | indent(4) }}
@ -87,8 +87,6 @@ server {
{% else %}
listen 443 ssl http2;
listen [::]:443 ssl http2;
{% endif %}
server_name {{ domains[1:] | join(' ') }};
{% if proxy_protocol is defined %}
listen 442 ssl http2 proxy_protocol;
@ -103,6 +101,8 @@ server {
port_in_redirect off;
{% endif %}
{% endif %}
server_name {{ domains[1:] | join(' ') }};
{% if ssl_certificate is defined %}
{{ ssl_certificate }}