[my previous post contained some irrelevant observations I
thought I'd deleted.  Reposting to reduce confusion]

In mod_rewrite.c, I see
    ap_hook_translate_name(hook_uri2file, NULL, NULL, APR_HOOK_FIRST);

In mod_proxy.c, I see
    /* fixup before mod_rewrite, so that the proxied url will not
     * escaped accidentally by our fixup.
    static const char * const aszSucc[]={ "mod_rewrite.c", NULL };
    ap_hook_translate_name(proxy_trans, aszSucc, NULL, APR_HOOK_FIRST);

What exactly is the risk that's protecting against?  I'd like to run the
mod_rewrite hook before the mod_proxy one, to have the mod_rewrite
environment variables available in proxy_trans.

It looks to me as if the only thing that'll affect that ordering is 
    if (r->proxyreq) {
        /* someone has already set up the proxy, it was possibly ourselves
         * in proxy_detect
        return OK;

So, presumably it should work if I run two proxy_trans hooks: the
first just makes the above check and returns DECLINED if not;
the second makes the same check but follows it with the
ProxyPass stuff.

Or am I missing something deeper?

Nick Kew

Reply via email to