This is just a guess, but do you have a config that looks something like this?
config :hello, HelloWeb.Endpoint,
url: [host: "example.com"],
force_ssl: [rewrite_on: [:x_forwarded_proto]]
If so, the host set here will be used for the target of the SSL redirect. To use the current host instead, change force_ssl
to:
force_ssl: [rewrite_on: [:x_forwarded_proto], host: nil]