Re: A reverse proxy question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/22/07, Dragon <dragon@xxxxxxxxxxxxxxxxxx> wrote:
Before asking my question, I need to explain a little about what I am
trying to do.

I have a reverse proxy set up in Apache 2.0.54 using the instructions
detailed in http://www.apachetutor.org/admin/reverseproxies

It works great for the most part but I have one little thing that
causes me some problems in the Rails application I am proxying. The
problem revolves around some internal redirects the application does
that I am currently "fixing" by hard coding the URL as seen from the
outside world into the application where it does these page
redirects. This is not an ideal solution as it breaks things if I
access the application directly instead of through the proxy.

What I want to be able to do is to inform the application that it is
being accessed through the proxy so it can programmatically determine
the correct redirect URL regardless of how it is being accessed.
Essentially what I want to do is somehow pass the actual request URL
through the proxy to the application so it can dynamically fix the
URL to access the correct page.

So my question is this, is there some (easy?) way through either HTTP
headers or some other mechanism that I can inform the application
that it is being accessed through the proxy?

First question: Why aren't you just letting ProxyPassReverse do its
job? It should be able to handle rewriting of redirects.

Anyway, if you want the origin server to know that stuff went through
the proxy, there are lots of clues in the request headers by default.
Take a look at X-Forwarded-For, etc.

Or you can always add your own header:
RequestHeader Set X-Went-Through-Proxy Yes

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux