]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1762517 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 10 Oct 2016 12:32:17 +0000 (12:32 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 10 Oct 2016 12:32:17 +0000 (12:32 +0000)
mod_proxy: log diagnostics during ProxyPass[Match]

To help out users when debugging ProxyPass and ProxyPassMatch, log all
match attempts (at trace2), as well as matches that are either
successful or explicitly disabled (at trace1).
Submitted by: jchampion
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1764077 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/mod_proxy.c

diff --git a/STATUS b/STATUS
index ac3182e8b355920a6f64b504f8d7e6041e4002bd..9b3ef7cbae0b600de60735aaa1b0b3ab8b028aea 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -117,12 +117,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_proxy: add log trace points to help users diagnose problems with
-     ProxyPass[Match].
-     trunk patch: http://svn.apache.org/r1762517
-     2.4.x patch: trunk works (modulo aplog numbers)
-     +1: jchampion, jim, ylavic
-
   *) event: Don't assume sizeof.
      trunk patch: http://svn.apache.org/r1732228
      2.4.x patch: trunk works
index 1ab17da1c95570960c41f66717b9f09470d564b1..d47127f37cb46714b03a32de4c84809ac34e2513 100644 (file)
@@ -649,9 +649,18 @@ PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent,
         fake = ent->fake;
         real = ent->real;
     }
+
+    ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, APLOGNO(03461)
+                  "attempting to match URI path '%s' against %s '%s' for "
+                  "proxying", r->uri, (ent->regex ? "pattern" : "prefix"),
+                  fake);
+
     if (ent->regex) {
         if (!ap_regexec(ent->regex, r->uri, AP_MAX_REG_MATCH, regm, 0)) {
             if ((real[0] == '!') && (real[1] == '\0')) {
+                ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(03462)
+                              "proxying is explicitly disabled for URI path "
+                              "'%s'; declining", r->uri);
                 return DECLINED;
             }
             /* test that we haven't reduced the URI */
@@ -695,6 +704,9 @@ PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent,
 
         if (len != 0) {
             if ((real[0] == '!') && (real[1] == '\0')) {
+                ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(03463)
+                              "proxying is explicitly disabled for URI path "
+                              "'%s'; declining", r->uri);
                 return DECLINED;
             }
             if (nocanon && len != alias_match(r->unparsed_uri, ent->fake)) {
@@ -723,6 +735,11 @@ PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent,
         if (ent->flags & PROXYPASS_NOQUERY) {
             apr_table_setn(r->notes, "proxy-noquery", "1");
         }
+
+        ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(03464)
+                      "URI path '%s' matches proxy handler '%s'", r->uri,
+                      found);
+
         return OK;
     }