Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 206749B83 for ; Thu, 29 Mar 2012 12:39:34 +0000 (UTC) Received: (qmail 25073 invoked by uid 500); 29 Mar 2012 12:39:31 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 25050 invoked by uid 500); 29 Mar 2012 12:39:31 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 25042 invoked by uid 99); 29 Mar 2012 12:39:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2012 12:39:31 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL,TO_NO_BRKTS_PCNT,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [195.238.6.175] (HELO mailrelay002.isp.belgacom.be) (195.238.6.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2012 12:39:23 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBAIlXdE9R8eYX/2dsb2JhbAANNoVMtwRVGiMWCwILAwIBAgFYCAEBiBGsNYoxglSIJIUPgRgElWGJUIgVgTKBUw Received: from 23.230-241-81.adsl-static.isp.belgacom.be (HELO [192.168.111.111]) ([81.241.230.23]) by relay.skynet.be with ESMTP; 29 Mar 2012 14:39:02 +0200 Message-ID: <4F7457E6.4000505@kantl.be> Date: Thu, 29 Mar 2012 14:39:02 +0200 From: Ron Van den Branden Organization: CTB-KANTL User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: users@httpd.apache.org Content-Type: multipart/alternative; boundary="------------020903030304030002010703" Subject: [users@httpd] mod_proxy: ProxyPreserveHost omits start of proxied path --------------020903030304030002010703 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, I am setting up a reverse proxy configuration that will proxy all requests starting with /apps/ to a Tomcat server running on a closed port. I have set up following configuration in httpd.conf: ProxyRequests off ProxyPass/apps/ http://localhost:8082/ ProxyPassReverse/apps/http://localhost:8082/ ProxyPassReverseCookiePath/apps/ / This generally works, even for internal redirections inside the Tomcat apps I'm addressing. Suppose my Tomcat app is internally accessible at , and this request is internally redirected to , a request for is correctly redirected to . Yet, there's a webstart application inside a Tomcat app that needs the *original* URL, instead of the proxied 'localhost:8082' URL. Hence, I tried by adding: ProxyPreserveHost on But this does not work 100%: -internal redirects inside the Tomcat app omit the /apps/ part from the redirected URL. For example, a request for now ends up at . -also (and probably related): the webstart application inside the Tomcat app doesn't preserve the /app/ part of the original request, and fails. All does work perfectly, however, with ProxyPreserveHost switched on, when the entire URL space is proxied: "ProxyPass / http://localhost:8082/" etc. But I explicitly want to limit the proxying to just one URL pattern, starting with '/apps/'. How can the '/apps/' part of the original request be passed on to the proxied URL (as apparently was the case with ProxyPreserveHost switched off)? (Note: proxying to http://localhost:8082/apps/ is not an option, as there is no physical /apps/ folder there). I hope this sketches my problem. I have the feeling I'm almost there; any help much appreciated! Ron --------------020903030304030002010703 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi,

I am setting up a reverse proxy configuration that will proxy all requests starting with /apps/ to a Tomcat server running on a closed port. I have set up following configuration in httpd.conf:
  ProxyRequests	off
  ProxyPass            /apps/    http://localhost:8082/
  ProxyPassReverse    /apps/    http://localhost:8082/
  ProxyPassReverseCookiePath /apps/ /
This generally works, even for internal redirections inside the Tomcat apps I'm addressing. Suppose my Tomcat app is internally accessible at <http://localhost:8082/my_app/>, and this request is internally redirected to <http://localhost:8082/my_app/index.htm>, a request for  <http://mydomain/apps/my_app/> is correctly redirected to <http://mydomain/apps/my_app/index.htm>.

Yet, there's a webstart application inside a Tomcat app that needs the *original* URL, instead of the proxied 'localhost:8082' URL. Hence, I tried by adding:
  ProxyPreserveHost	on
But this does not work 100%:
    -internal redirects inside the Tomcat app omit the /apps/ part from the redirected URL. For example, a request for <http://mydomain/apps/my_app/> now ends up at <http://mydomain/my_app/index.htm>.
    -also (and probably related): the webstart application inside the Tomcat app doesn't preserve the /app/ part of the original request, and fails.

All does work perfectly, however, with ProxyPreserveHost switched on, when the entire URL space is proxied: "ProxyPass     /    http://localhost:8082/" etc. But I explicitly want to limit the proxying to just one URL pattern, starting with '/apps/'. How can the '/apps/' part of the original request be passed on to the proxied URL (as apparently was the case with ProxyPreserveHost switched off)? (Note: proxying to http://localhost:8082/apps/ is not an option, as there is no physical /apps/ folder there).

I hope this sketches my problem.  I have the feeling I'm almost there; any help much appreciated!

Ron --------------020903030304030002010703--