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:
|
||||
|
||||
# Host
|
||||
# Hosts
|
||||
#
|
||||
# The hosts that will be used to serve the app. The proxy will only route requests
|
||||
# to this host 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.
|
||||
#
|
||||
# Specify one of `host` or `hosts`.
|
||||
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:
|
||||
- foo.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"
|
||||
end
|
||||
|
||||
if config["host"].present? && config["hosts"].present?
|
||||
error "Must use either 'host' or 'hosts', not both"
|
||||
if (config.keys & [ "host", "hosts" ]).size > 1
|
||||
error "Specify one of 'host' or 'hosts', not both"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user