diff --git a/lib/reverse_proxy_plug.ex b/lib/reverse_proxy_plug.ex index 389f39b..2a681d5 100644 --- a/lib/reverse_proxy_plug.ex +++ b/lib/reverse_proxy_plug.ex @@ -255,7 +255,8 @@ defmodule ReverseProxyPlug do proxy_req_host = if options[:preserve_host_header] do - conn.host + {"host", host} = List.keyfind(conn.req_headers, "host", 0, {"host", conn.host}) + host else host_header_from_url(url) end