[mod_proxy] set X-Forwarded-Host (fixes
lighttpd appends the request "Host" to the non-standard header "X-Host"
when acting as a reverse proxy.  This patch additionally appends "Host"
to the non-standard header "X-Forwarded-Host" to match the convention in
some other web servers
x-ref:
"mod_proxy should send the X-Forwarded-Host header to the proxied server"
@@ -665,6 +665,7 @@ static int proxy_create_env(server *srv, handler_ctx *hctx) {
* which is NULL if it is not set */
if (!buffer_string_is_empty(con->request.http_host)) {
proxy_set_header(con, "X-Host", con->request.http_host->ptr);
+ proxy_set_header(con, "X-Forwarded-Host", con->request.http_host->ptr);
}
proxy_set_header(con, "X-Forwarded-Proto", con->uri.scheme->ptr);
