diff --git a/lib/kamal/configuration/docs/proxy.yml b/lib/kamal/configuration/docs/proxy.yml index 0ca6befd..e754eb36 100644 --- a/lib/kamal/configuration/docs/proxy.yml +++ b/lib/kamal/configuration/docs/proxy.yml @@ -7,16 +7,14 @@ # run on the same proxy. proxy: - # Hosts + # Host # - # These are the hosts that will be used to serve the app. If you deploy more - # than one application to a single host, the proxy will route requests based - # these 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 that do have a host set. - hosts: - - foo.example.com + host: foo.example.com # App port # diff --git a/lib/kamal/configuration/proxy.rb b/lib/kamal/configuration/proxy.rb index a3161e1b..2671b4c8 100644 --- a/lib/kamal/configuration/proxy.rb +++ b/lib/kamal/configuration/proxy.rb @@ -37,7 +37,7 @@ def ssl? def deploy_options { - host: proxy_config.fetch("hosts", []).first, + host: proxy_config["host"], tls: proxy_config["ssl"], "deploy-timeout": proxy_config["deploy_timeout"], "drain-timeout": proxy_config["drain_timeout"], diff --git a/lib/kamal/configuration/validator/proxy.rb b/lib/kamal/configuration/validator/proxy.rb index 2b055570..a4ee19bf 100644 --- a/lib/kamal/configuration/validator/proxy.rb +++ b/lib/kamal/configuration/validator/proxy.rb @@ -2,7 +2,7 @@ class Kamal::Configuration::Validator::Proxy < Kamal::Configuration::Validator def validate! super - if config["hosts"].blank? && config["ssl"] + if config["host"].blank? && config["ssl"] error "Must set a host to enable automatic SSL" end end diff --git a/test/configuration/proxy_test.rb b/test/configuration/proxy_test.rb index 6dac27ff..3aa3f85e 100644 --- a/test/configuration/proxy_test.rb +++ b/test/configuration/proxy_test.rb @@ -9,7 +9,7 @@ class ConfigurationEnvTest < ActiveSupport::TestCase end test "ssl with host" do - @deploy[:proxy] = { "ssl" => true, "hosts" => [ "example.com" ] } + @deploy[:proxy] = { "ssl" => true, "host" => "example.com" } assert_equal true, config.proxy.ssl? end