Re: Proxying From Directory To App On Port

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

 



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.

On Tuesday, August 25, 2015, Kurtis Rader <krader@xxxxxxxxxxxxx> wrote:
On Mon, Aug 24, 2015 at 8:30 PM, Steven Shi <steven200796@xxxxxxxxx> wrote:
I'm trying to proxy /app to localhost:2000 (where the app is hosted).  Unfortunately, whenever the app makes a GET/POST request, the port 2000 is lost and the request is made to localhost:80 rather than localhost:2000.

I feel as if the solution is something simple but I haven't been able to discover it from three days of trial and error.

Too little data for a meaningful response. But have you looked at the ProxyPassReverse directive?

If adding a ProxyPassReverse directive doesn't solve your problem you'll need to tell us about the relevant portions of your web server config and how you are testing the behavior. In particular it is not clear what you mean by "whenever the app makes a GET/POST request" since you also say "the app is hosted" at localhost:2000. In other words the flow of requests and responses is not clear from your description.

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

[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