Commit 8922da13 authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Implement type:redirect

parent 5ee75f56
......@@ -50,7 +50,7 @@ md5sum = f20d6c3d2d94fb685f8d26dfca1e822b
[template-default-slave-virtualhost]
filename = templates/default-virtualhost.conf.in
md5sum = 8ebca8b912cc2a498084b0694d035470
md5sum = 3913387908485adc07b1cd89ad899cd5
[template-cached-slave-virtualhost]
filename = templates/cached-virtualhost.conf.in
......
......@@ -80,8 +80,10 @@
regexp (.*)
to /VirtualHostBase/{scheme}%2F%2F{hostonly}:{{ slave_parameter.get('virtualhostroot-https-port', '443') }}%2F{{ slave_parameter.get('path', '') }}%2FVirtualHostRoot/{1}
}
{% elif slave_type == 'redirect' -%}
# TODO-Caddy RewriteRule (.*) {{ slave_parameter.get('https-url', slave_parameter.get('url', ''))}}$1 [R,L]
{% elif slave_type == 'redirect' and backend_url %}
redir 302 {
/ {{ backend_url }}{uri}
}
{% else -%}
{% if 'default-path' in slave_parameter %}
redir 301 {
......@@ -148,8 +150,10 @@
{%- if https_only %}
redir / https://{host}{uri}
{% elif slave_type == 'redirect' -%}
# TODO-Caddy RewriteRule (.*) {{slave_parameter.get('url', '')}}$1 [R,L]
{% elif slave_type == 'redirect' and slave_parameter.get('url', '') %}
redir 302 {
/ {{ slave_parameter.get('url', '') }}{uri}
}
{% elif slave_type == 'zope' and backend_url %}
proxy / {{ backend_url }} {
transparent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment