Do not allow both host and hosts for proxy configuration

This commit is contained in:
Dmytro Shteflyuk
2024-09-28 20:13:14 -04:00
parent 1d48a0fb0a
commit 8df7d7d92d
3 changed files with 10 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ proxy:
# Hosts
#
# The hosts that will be used to serve the app. The proxy will only route requests
# to this host to your app.
# 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.

View File

@@ -6,6 +6,10 @@ class Kamal::Configuration::Validator::Proxy < Kamal::Configuration::Validator
if config["host"].blank? && config["hosts"].blank? && config["ssl"]
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"
end
end
end
end