Simplified proxy hosts validation and documentation, similar to accessory config
This commit is contained in:
@@ -17,24 +17,16 @@
|
|||||||
# `proxy: true` or providing a proxy configuration.
|
# `proxy: true` or providing a proxy configuration.
|
||||||
proxy:
|
proxy:
|
||||||
|
|
||||||
# Host
|
# Hosts
|
||||||
#
|
#
|
||||||
# The hosts that will be used to serve the app. The proxy will only route requests
|
# The hosts that will be used to serve the app. The proxy will only route requests
|
||||||
# to this host to your app.
|
# to this host to your app.
|
||||||
#
|
#
|
||||||
# If no hosts are set, then all requests will be forwarded, except for matching
|
# If no hosts are set, then all requests will be forwarded, except for matching
|
||||||
# requests for other apps deployed on that server that do have a host set.
|
# requests for other apps deployed on that server that do have a host set.
|
||||||
|
#
|
||||||
|
# Specify one of `host` or `hosts`.
|
||||||
host: foo.example.com
|
host: foo.example.com
|
||||||
# If multiple hosts are needed, these can be specified by comma-separating the hosts.
|
|
||||||
host: foo.example.com,bar.example.com
|
|
||||||
|
|
||||||
# Hosts
|
|
||||||
#
|
|
||||||
# The hosts that will be used to serve the app. The proxy will only route requests
|
|
||||||
# to these hosts to your app.
|
|
||||||
#
|
|
||||||
# If no hosts are set, then all requests will be forwarded, except for matching
|
|
||||||
# requests for other apps deployed on that server that do have a host set.
|
|
||||||
hosts:
|
hosts:
|
||||||
- foo.example.com
|
- foo.example.com
|
||||||
- bar.example.com
|
- bar.example.com
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ class Kamal::Configuration::Validator::Proxy < Kamal::Configuration::Validator
|
|||||||
error "Must set a host to enable automatic SSL"
|
error "Must set a host to enable automatic SSL"
|
||||||
end
|
end
|
||||||
|
|
||||||
if config["host"].present? && config["hosts"].present?
|
if (config.keys & [ "host", "hosts" ]).size > 1
|
||||||
error "Must use either 'host' or 'hosts', not both"
|
error "Specify one of 'host' or 'hosts', not both"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user