On Mon, Aug 24, 2015 at 9:52 PM, Steven Shi <steven200...@gmail.com> wrote:

> I have looked at and tried using the ProxyPassReverse directive.
>
> So the app communicates with the back end over port 2000.  Any requests
> the app makes are sent to localhost:2000/foo to be processed by the back
> end.
>
> Currently the relevant configuration is
>
> ProxyPass /app http://localhost:2000
> ProxyPassReverse /app http://localhost:2000
>
> Basically, when the frontend of the app at localhost:2000 sends a GET
> request, it's being sent as localhost:80/request rather than
> localhost:2000/request.  Likewise, the remote IP address is shown as
> localhost:80 rather than localhost:2000.
>
> If I go straight to localhost:2000, the app works as intended and makes
> all requests to localhost:2000/request while showing the remote IP to be
> localhost:2000.
>

I can appreciate that you are frustrated by seemingly non-sensical behavior
from the programs you're working with. I recently experienced a similar
situation when trying to setup a virtual host that would proxy requests to
another http server while the Apache httpd daemon also honored my
mod_rewrite rules for blacklisted sources which should not be proxied. It
took me several hours to figure out how to configure Apache httpd to do
what I wanted. Nonetheless, your description of the situation is incoherent.

Let us start with your last paragraph where you say "If I go straight to
localhost:2000". I assume you are saying that if you enter "
http://localhost:2000/"; in your web browser you get the expected behavior.
Is your Apache web server listening on port 2000? The reason I ask that
question is due to your statement that "any requests the app makes are sent
to localhost:2000". Which implies the app in question is directly
connecting to the backend without being proxied by the Apache httpd
process. What is this "app" and is it connecting to port 2000 or port 80 on
the local host?

What is the "app" in the statement "any requests the app makes"? Is it a
web browser or something else? And if something else please provide more
details. What do you mean by "the remote IP address is shown as
localhost:80"? Shown where? By what program?

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Reply via email to