Procházet zdrojové kódy

Fix whitespace in nginx stream config

jbowring před 1 rokem
rodič
revize
4452f014b9

+ 4 - 4
backend/templates/_certificates_stream.conf

@@ -1,13 +1,13 @@
-{% if certificate and certificate_id > 0 -%}
+{% if certificate and certificate_id > 0 %}
 {% if certificate.provider == "letsencrypt" %}
   # Let's Encrypt SSL
   include conf.d/include/ssl-cache-stream.conf;
   include conf.d/include/ssl-ciphers.conf;
   ssl_certificate /etc/letsencrypt/live/npm-{{ certificate_id }}/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/npm-{{ certificate_id }}/privkey.pem;
-{% else %}
+{%- else %}
   # Custom SSL
   ssl_certificate /data/custom_ssl/npm-{{ certificate_id }}/fullchain.pem;
   ssl_certificate_key /data/custom_ssl/npm-{{ certificate_id }}/privkey.pem;
-{% endif %}
-{% endif %}
+{%- endif -%}
+{%- endif -%}

+ 7 - 13
backend/templates/stream.conf

@@ -5,14 +5,10 @@
 {% if enabled %}
 {% if tcp_forwarding == 1 or tcp_forwarding == true -%}
 server {
-  listen {{ incoming_port }}{% if certificate %} ssl{% endif %};
-{% if ipv6 -%}
-  listen [::]:{{ incoming_port }}{% if certificate %} ssl{% endif %};
-{% else -%}
-  #listen [::]:{{ incoming_port }}{% if certificate %} ssl{% endif %};
-{% endif %}
+  listen {{ incoming_port }} {%- if certificate %} ssl {%- endif %};
+  {% unless ipv6 -%} # {%- endunless -%} listen [::]:{{ incoming_port }} {%- if certificate %} ssl {%- endif %};
 
-{% include "_certificates_stream.conf" %}
+  {%- include "_certificates_stream.conf" %}
 
   proxy_pass {{ forwarding_host }}:{{ forwarding_port }};
 
@@ -21,14 +17,12 @@ server {
   include /data/nginx/custom/server_stream_tcp[.]conf;
 }
 {% endif %}
-{% if udp_forwarding == 1 or udp_forwarding == true %}
+
+{% if udp_forwarding == 1 or udp_forwarding == true -%}
 server {
   listen {{ incoming_port }} udp;
-{% if ipv6 -%}
-  listen [::]:{{ incoming_port }} udp;
-{% else -%}
-  #listen [::]:{{ incoming_port }} udp;
-{% endif %}
+  {% unless ipv6 -%} # {%- endunless -%} listen [::]:{{ incoming_port }} udp;
+
   proxy_pass {{ forwarding_host }}:{{ forwarding_port }};
 
   # Custom