</example>
</section> <!-- /examples -->
+ <section id="handler"><title>Access via Handler</title>
+
+ <p>You can also force a request to be handled as a reverse-proxy
+ request, by creating a suitable Handler pass-thru. For example,
+ the below will pass all PHP scripts to the specified
+ reverse-proxy FCGI server:
+ </p>
+
+ <example><title>Reverse Proxy PHP scripts</title>
+ <highlight language="config">
+<FilesMatch \.php$>
+ SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/"
+</FilesMatch&lgt;
+ </highlight>
+ </example>
+ </section> <!-- /handler -->
+
<section id="workers"><title>Workers</title>
<p>The proxy manages the configuration of origin servers and their
struct dirconn_entry *list = (struct dirconn_entry *)conf->dirconn->elts;
/* is this for us? */
- if (!r->proxyreq || !r->filename || strncmp(r->filename, "proxy:", 6) != 0)
+ if (!r->filename) {
+ return DECLINED;
+ }
+
+ if (!r->proxyreq) {
+ /* We may have forced the proxy handler via config or .htaccess */
+ if (r->handler &&
+ strncmp(r->handler, "proxy:", 6) == 0 &&
+ strncmp(r->filename, "proxy:", 6) != 0) {
+ r->proxyreq = PROXYREQ_REVERSE;
+ r->filename = apr_pstrcat(r->pool, r->handler, r->filename, NULL);
+ apr_table_setn(r->notes, "rewrite-proxy", "1");
+ }
+ else {
+ return DECLINED;
+ }
+ } else if (strncmp(r->filename, "proxy:", 6) != 0) {
return DECLINED;
+ }
/* handle max-forwards / OPTIONS / TRACE */
if ((str = apr_table_get(r->headers_in, "Max-Forwards"))) {