Forum: Radiant CMS Re: HTTP_X_FORWARDED_HOST breaks Apache proxying

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bbb08090c4f8d7f89d9f474e9d57ba94?d=identicon&s=25 Earl Chew (Guest)
on 2007-06-02 06:01
(Received via mailing list)
Earl Chew <earl_chew@yahoo.com> 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...

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.
767bedcbd5dd54d874a602925d98182e?d=identicon&s=25 Oliver Baltzer (Guest)
on 2007-06-02 07:11
(Received via mailing list)
On 02/06/07 01:00 AM, Earl Chew was heard to say:
> Earl Chew <earl_chew@yahoo.com> 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
This topic is locked and can not be replied to.