Re: mod_proxy: ProxyPreserveHost omits start of proxied path

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

 



Hi,

On 30/03/2012 12:39, Tom Evans wrote:
On Fri, Mar 30, 2012 at 11:14 AM, Bruno Tréguier<Bruno.Treguier@xxxxxxx>  wrote:
Would it be possible for you to do new captures of the network traffic, but
in "pcap" format ? That way we could use tools like wireshark to analyse the
traces, instead of the ascii dump you provided, whih (in my opinion) is
difficult to read.
I'm looking at preserveHostOn_redirect.out. If you look at the section
"08:54:11.860428 … localhost.8082>  localhost.34050" , this is the
backend replying to Apache (afaict).


Thanks a lot, guys, for your kind and patient help! Sorry about my (tcp)dumbness, and many thanks, Tom, for diving straight into that ascii soup.

You should be using something like this:

   ProxyPassReverse /apps/ http://ctb.dev.kantl.be/

as that is the URI structure your backend is generating.

Ok, this makes sense (to our server, too). This fixes the issue with redirections by the proxied app, great!

Yet, there's one scenario that's still slipping between the mazes, which unfortunately seems to fall between both Apache and the proxied webapp (serving the eXist XML database (http://exist-db.org) via Tomcat). The proxied webapp provides a Java webstart client that allows for remote access to the XML database. Yet, using these proxy settings:

  ProxyRequests	    off
  ProxyPreserveHost on

  ProxyPass /apps/      http://localhost:8082/
  ProxyPassReverse /apps/    http://ctb.dev.kantl.be/
  ProxyPassReverseCookiePath /apps/ /

Requests for the webstart client (http://ctb.dev.kantl.be/apps/TW/webstart/exist.jnlp) fail on the backend side. Though the original proxied request lands at the right place, I guess the Java webstart file makes further requests to the wrong URL. Looking at the logs, the backend side apparently sees this URL: http://ctb.dev.kantl.be/TW/webstart/exist.jnlp, instead of the original one with the '/apps/' path part. I've checked this further via a function of the proxied eXist webapp: request:get-url(), which returns the URL of the current request. Apparently, when calling that function for http://ctb.dev.kantl.be/apps/TW/eXide/, following URL is returned: http://ctb.dev.kantl.be/TW/eXide/, hence without the '/apps/' part.

The problem seems to be that I want the '/apps/' part in the request in order to limit proxying behaviour to requests starting with that part. Yet, that '/apps/' part is not part of a physical path in the proxied app folder structure, and hence needs to be filtered out in the proxied request (which is what ProxyPass and ProxyPassReverse do, IIUC). Yet, some parts of that app need access to the original URL, including that '/apps/' part. Is there a way to pass on the '/apps/' part of the original request to the proxied app, or is this outside of Apache's reach?

Sorry about the muddiness; I hope to have made myself clear.

Kind regards,

Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-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