3

I have an Apache httpd proxy (proxy.example.com) that proxies requests to an application server (app.example.com). Now I'm trying to overwrite the Host header in requests to app.example.com with a directive like this:

RequestHeader set Host proxy.example.com

However, this only adds a new header X-Forwarded-Host: proxy.example.com into the request. The host header itself remains unchanged at Host: app.example.com.

Does anyone have an idea why this is the case? I would expect RequestHeader set Host <name> to overwrite the Host header as described in the documentation of the RequestHeader Directive...

set

The request header is set, replacing any previous header with this name

1
  • Did you figure out how set the host header? Having the same issue, forwarding requests from one Apache to another in our test environments, the recieving Apache vhost config fails since it does not care about the x-forwarded-host header. So I should be able to set the host header as well. In production where we use BigIp/F5 this works as a charm.
    – rhellem
    Nov 11, 2019 at 13:54

0

You must log in to answer this question.

Browse other questions tagged .