# Re: HTTP\_X\_FORWARDED\_HOST breaks Apache proxying

**URL:** <https://www.ruby-forum.com/t/re-http-x-forwarded-host-breaks-apache-proxying/105759>\
**Category:** Radiant CMS\
**Created:** [June 2, 2007, 6:01am UTC](https://www.ruby-forum.com/t/re-http-x-forwarded-host-breaks-apache-proxying/105759 "2007-06-02T06:01:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Earl\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3be4f8/32.png) [@Earl\_C](https://www.ruby-forum.com/u/Earl_C)\
**Post date:** [June 2, 2007, 6:01am UTC](https://www.ruby-forum.com/t/re-http-x-forwarded-host-breaks-apache-proxying/105759/1 "2007-06-02T06:01:49Z")

</div>

Earl C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:The problem is that when Apache  
forwards the request using proxypass, it includes the following in the  
HTML:

* * *

## HTTP\_X\_FORWARDED\_HOST: foo HTTP\_USER\_AGENT: Wget/1.10.2 (Red Hat modified) SCRIPT\_NAME: / SERVER\_PROTOCOL: HTTP/1.1 HTTP\_HOST: 127.0.0.1:3000

There is a patch for Apache to add ProxyAddXHeaders:

[http://mail-archives.apache.org/mod\_mbox/httpd-dev/200702.mbox/browser](http://mail-archives.apache.org/mod_mbox/httpd-dev/200702.mbox/browser)

Setting this option Off causes Apache to refrain from inserting the  
HTTP\_X\_\* headers making the proxying action transparent.

* * *

Need Mail bonding?  
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

---

<div class="post-metadata">

**Author:** ![Earl\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3be4f8/32.png) [@Earl\_C](https://www.ruby-forum.com/u/Earl_C)\
**Post date:** [June 2, 2007, 7:11am UTC](https://www.ruby-forum.com/t/re-http-x-forwarded-host-breaks-apache-proxying/105759/2 "2007-06-02T07:11:55Z")

</div>

On 02/06/07 01:00 AM, Earl C. was heard to say:

> Earl C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:The problem is that when Apache forwards the request using proxypass, it includes the following in the HTML:
> 
> * * *
> 
> ## HTTP\_X\_FORWARDED\_HOST: foo HTTP\_USER\_AGENT: Wget/1.10.2 (Red Hat modified) SCRIPT\_NAME: / SERVER\_PROTOCOL: HTTP/1.1 HTTP\_HOST: 127.0.0.1:3000

Hi Earl,

the Apache headers are fine and are supposed to be set this way. The  
problem is that Radiant/Rails does not know what the base URL of your  
application is. Try setting:

ActionController::AbstractRequest.relative\_url\_root = ‘/radiant’

in your environment.rb. I am not sure if this is still the right way  
of doing it, but it used to be like this a couple of months ago.

Cheers,  
Oliver
