mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
www/caddy: Fix redirect regression (#4390)
www/caddy: Fix redirect regression, always attach http to redir instead of empty default
This commit is contained in:
@@ -399,8 +399,13 @@ http://{{ domain }} {
|
||||
{% if handle.HandleDirective == "reverse_proxy" and handle.ToPath|default("") != "" %}
|
||||
rewrite * {{ handle.ToPath }}{uri}
|
||||
{% endif %}
|
||||
{# http:// is the empty default #}
|
||||
{% set protocol = 'https://' if handle.HttpTls == "1" else 'h2c://' if handle.HttpTls == "2" else '' -%}
|
||||
{# http:// is the empty default for reverse_proxy #}
|
||||
{% set protocol = (
|
||||
"http://" if handle.HttpTls == "0" and handle.HandleDirective == "redir" else
|
||||
"https://" if handle.HttpTls == "1" else
|
||||
"h2c://" if handle.HttpTls == "2" else
|
||||
''
|
||||
) %}
|
||||
{% set formatted_domains = [] -%}
|
||||
{% for domain in handle.ToDomain.split(',') -%}
|
||||
{% set is_ipv6 = (':' in domain and domain.count(':') >= 2) -%}
|
||||
|
||||
Reference in New Issue
Block a user