diff --git a/lib/kamal/configuration/docs/proxy.yml b/lib/kamal/configuration/docs/proxy.yml index 444e2da7..76ec3e41 100644 --- a/lib/kamal/configuration/docs/proxy.yml +++ b/lib/kamal/configuration/docs/proxy.yml @@ -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 diff --git a/lib/kamal/configuration/validator/proxy.rb b/lib/kamal/configuration/validator/proxy.rb index 3e2eda19..b9e11cd9 100644 --- a/lib/kamal/configuration/validator/proxy.rb +++ b/lib/kamal/configuration/validator/proxy.rb @@ -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