Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos-caddy
Commits
a040c759
Commit
a040c759
authored
May 21, 2018
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend: Support missing url
If url is missing, the generated files shall be correct.
parent
6b21df6e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
software/caddy-frontend/buildout.hash.cfg
software/caddy-frontend/buildout.hash.cfg
+1
-1
software/caddy-frontend/templates/default-virtualhost.conf.in
...ware/caddy-frontend/templates/default-virtualhost.conf.in
+14
-9
No files found.
software/caddy-frontend/buildout.hash.cfg
View file @
a040c759
...
...
@@ -55,7 +55,7 @@ md5sum = 4dbb8560e4de1af2a0706b020e713fe7
[template-default-slave-virtualhost]
filename = templates/default-virtualhost.conf.in
md5sum =
8a0b6c937384c299dd36274c9fa8d104
md5sum =
07b3a9a0f25d1a173066a39293f09cd6
[template-cached-slave-virtualhost]
filename = templates/cached-virtualhost.conf.in
...
...
software/caddy-frontend/templates/default-virtualhost.conf.in
View file @
a040c759
...
...
@@ -9,6 +9,7 @@
{%- set https_only = ('' ~ slave_parameter.get('https-only', '')).lower() in TRUE_VALUES -%}
{%- set slave_type = slave_parameter.get('type', '') -%}
{%- set host_list = [slave_parameter.get('custom_domain')] + server_alias_list -%}
{%- set backend_url = slave_parameter.get('https-url', slave_parameter.get('url', '')) %}
{%- set http_host_list = [] %}
{%- set https_host_list = [] %}
{%- for host in host_list %}
...
...
@@ -55,8 +56,8 @@
# TODO-Caddy RequestHeader edit Accept-Encoding "(^gzip,.*|.*, gzip,.*|.*, gzip$|^gzip$)" "gzip"
{% endif %}
{% if slave_type == 'zope' -%}
proxy / {{
slave_parameter.get('https-url', slave_parameter.get('url', ''))
}} {
{% if slave_type == 'zope'
and backend_url
-%}
proxy / {{
backend_url
}} {
transparent
timeout 600s
{%- if ssl_proxy_verify %}
...
...
@@ -78,9 +79,9 @@
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' -%}
{% elif slave_type == 'redirect'
and backend_url
-%}
redir 302 {
/ {{
slave_parameter.get('https-url', slave_parameter.get('url', ''))
}}{uri}
/ {{
backend_url
}}{uri}
}
{% else -%}
{% if 'default-path' in slave_parameter %}
...
...
@@ -89,7 +90,8 @@
/ {scheme}://{host}/{{ slave_parameter.get('default-path') }}
}
{% endif -%}
proxy / {{ slave_parameter.get('https-url', slave_parameter.get('url', '')) }} {
{%- if backend_url %}
proxy / {{ backend_url }} {
transparent
timeout 600s
{%- if ssl_proxy_verify %}
...
...
@@ -101,6 +103,7 @@
insecure_skip_verify
{%- endif %}
}
{%- endif %}
{% endif -%}
}
...
...
@@ -136,12 +139,12 @@
{%- if https_only %}
redir / https://{host}{uri}
{% elif slave_type == 'redirect' -%}
{% elif slave_type == 'redirect'
and backend_url
-%}
redir 302 {
/ {{
slave_parameter.get('https-url', slave_parameter.get('url', ''))
}}{uri}
/ {{
backend_url
}}{uri}
}
{% elif slave_type == 'zope' -%}
proxy / {{
slave_parameter.get('https-url', slave_parameter.get('url', ''))
}} {
{% elif slave_type == 'zope'
and backend_url
-%}
proxy / {{
backend_url
}} {
transparent
timeout 600s
{%- if ssl_proxy_verify %}
...
...
@@ -170,6 +173,7 @@
/ {scheme}://{host}/{{ slave_parameter.get('default-path') }}
}
{% endif -%}
{%- if slave_parameter.get('url', '') %}
proxy / {{ slave_parameter.get('url', '') }} {
transparent
timeout 600s
...
...
@@ -182,6 +186,7 @@
insecure_skip_verify
{%- endif %}
}
{% endif -%}
{% endif -%}
# If nothing exist : put a nice error
# ErrorDocument 404 /notfound.html
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment