On Fri, Nov 4, 2011 at 01:18, Jodi Bosa <jodibosa@gmail.com> 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():
>
>
> static apr_status_t x_response_filter(ap_filter_t *f, apr_bucket_brigade
> *bb)
> {
> request_rec
*r, *subr;
> int
> status;
>
> request_rec *subr = ap_sub_req_lookup_uri("http://www.apache.org",
> r, f->next);
> status = ap_run_sub_req(subr);
> ap_destroy_sub_req(subr);
> }
>
>
> 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
|