Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 927179337 for ; Fri, 4 Nov 2011 08:11:10 +0000 (UTC) Received: (qmail 21946 invoked by uid 500); 4 Nov 2011 08:11:09 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 21777 invoked by uid 500); 4 Nov 2011 08:11:03 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 21753 invoked by uid 99); 4 Nov 2011 08:11:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 08:11:02 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sorinm@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 08:10:55 +0000 Received: by qyl38 with SMTP id 38so2843261qyl.18 for ; Fri, 04 Nov 2011 01:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=WRWn4TCD/EHRzWa3Bw8vDGtBstCbIsUCBvu8uhGQXbc=; b=dPgh74aEwa1u4c9gTLwJ/1yvk97fk5aYetrcoP+1dQrgZRjEtBp3ZKv5jOekWbv0Q1 wIXmj/5CLNLNFM6OuBw0OFJrQyx7aDaKIn9tp5kiqvqs6FLar5fiGDQccH6m8qgxzPOU fgmHaUK0vI45Vb/OwF1kHPN84DMU3etfmZQF8= MIME-Version: 1.0 Received: by 10.182.227.99 with SMTP id rz3mr2685014obc.4.1320394234179; Fri, 04 Nov 2011 01:10:34 -0700 (PDT) Received: by 10.182.149.102 with HTTP; Fri, 4 Nov 2011 01:10:34 -0700 (PDT) In-Reply-To: References: <20111101180257.72e2d22a@baldur> Date: Fri, 4 Nov 2011 09:10:34 +0100 Message-ID: Subject: Re: mod_proxy retry From: Sorin Manolache To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Nov 4, 2011 at 01:18, Jodi Bosa wrote: > thanks but unfortunately it seems mod_include #include virtual does not > appear to support requests to external servers (must not contain a scheme > or hostname - only path and query string). > > > Regardless, I also tried ap_sub_req_lookup_uri(): > > > =A0 static apr_status_t x_response_filter(ap_filter_t *f, apr_bucket_brig= ade > *bb) > =A0 { > =A0 =A0 =A0 =A0request_rec =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 *r, *subr; > =A0 =A0 =A0 =A0int > status; > > =A0 =A0 =A0 =A0request_rec *subr =3D ap_sub_req_lookup_uri("http://www.ap= ache.org", > r, f->next); > =A0 =A0 =A0 =A0status =3D ap_run_sub_req(subr); > =A0 =A0 =A0 =A0ap_destroy_sub_req(subr); > =A0 } > > > which seemed to succeed to make_sub_request() but later on mod_proxy's > proxy_handler() failed because of r->proxyreq was NULL. > You can still do it with ap_sub_req_lookup_uri. Just use something like RewriteEngine On RewriteRule /dummy/path http://external.proxy/path2 [P] and then ap_sub_req_method_uri("GET", "/dummy/path", r, f->next); The [P] in the rewriterule makes sure you have r->proxyreq not null. S