Re: Re: Proxying From Directory To App On Port

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

 



On Tue, Aug 25, 2015 at 3:46 PM, Steven Shi <steven200796@xxxxxxxxx> wrote:
yes, they are both located on port 2000. I am indeed using the reverse proxy option.

 On Tue, Aug 25, 2015 at 5:13 PM, Robert Webb <rwebb@xxxxxxxxxxxx> wrote:
Some clarification needed here.

Is the app and the jetty backend on the same server? If so, are you using the reverse proxy option because jetty typically would listen on port 80 and is on a different server from the app but you have a need for app and jetty on the same server so the jetty needed an alternate port?

We seem to have a language barrier. Robert was asking if you were using port 2000 for the Jetty server because it and the Apache web server were running on the same system. The only way they could "both [be] located on port 2000" is if they were running on different systems. You can't have two programs listening on the same TCP/IP port number.

Your private email to me makes it clear that you have an Apache http server handling requests on port 80 and and a Jetty http server handling requests on port 2000. Both servers are running on the same system. The "app" is using the jQuery _javascript_ library to handle HTTP requests. Whether or not the jQuery code is running in a browser controlled by a human is probably irrelevant. Nonetheless it might be helpful to know if the "app" is in fact browser side client code or something else.

Back to your original problem statement:

"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."

So we now know that "the app" is a jQuery program issuing a HTTP request with a URI like "/app/something" to the Apache httpd server on port 80. The Apache httpd server should be proxying the request to the Jetty server on port 2000 on the same system minus the "/app" URI prefix but is not doing so.

What do you mean by "the port 2000 is lost"? What data leads you to believe the Apache httpd server is not proxying the request?

Do you have virtual hosts defined in the Apache httpd server? If so have you confirmed "the app" is setting the HTTP_HOST header correctly?

When I'm baffled by the behavior of my Apache httpd server I enable additional diagnostic output. For example,

LoadModule dumpio_module libexec/apache2/mod_dumpio.so
LogLevel trace6
DumpIOInput On
DumpIOOutput On
LogLevel dumpio_module:trace7

I then issue a series of carefully constructed HTTP requests meant to eliminate irrelevant details and examine the error log for clues.

--
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