Changing request header before forward proxy in Apache

user2507613 picture user2507613 · Jun 21, 2013 · Viewed 9.8k times · Source

I have used "forward proxy" in Apache. I want to change part of request header before passing the request. for example i want to change host param in header. i have used this part of config in httpd.conf but it doesn't change header before passing the request.

Listen 7654
<VirtualHost *:7654>
    RequestHeader set Host "test.com"
    ProxyRequests On
</VirtualHost>

Answer

Andr&#233; Fernandes picture André Fernandes · Aug 21, 2015

I've found that adding ProxyPreserveHost On to the VirtualHost config enables rewriting of the Host: header as intended.