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...


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

  • 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 '19 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.