Mailing List Archive

Re: [mod_backhand-users] unique log entries
Martin Domig wrote:
> SetEnvIf Http_Backhandproxied "^10.*" backh
> #SetEnvIf BackhandProxied "^10.*" backh
> CustomLog /tmp/cluster2-access.log common env=!backh
> CustomLog /tmp/cluster2-backh-access.log common env=backh
>
> Doh, doesn't work. Neither using the Http_Backhandproxied nor the BackhandProxied
> variable.
> Does anyone have a suggestion or solution for me?

The concept is that BackhandProxied will *only* be set on the machined that is
being proxied to. Unfortunately, my code doesn't reflect that concept :-( A
one line patch fixes this -- it is in CVS and attached at the bottom of this
message. If the header exists at all, you know it was backhanded to you.
Otherwise, it originated from the client.

So you want something like this:

SetEnvIf BackhandProxied . bh
CustomLog /var/backhand/logs/frontend_access_log funky env=!bh
CustomLog /var/backhand/logs/backend_access_log funky env=bh

--- BEGIN PATCH ---
diff -u -r1.20 mod_backhand.c
--- mod_backhand.c 2001/02/05 04:27:23 1.20
+++ mod_backhand.c 2001/02/07 22:05:43
@@ -543,6 +543,7 @@
ap_table_setn(r->headers_in, "Connection", "Keep-Alive");
ap_table_setn(r->headers_in, "BackhandProxied", inet_ntoa(tempaddr));
ap_table_do(&build_request_headers, header, r->headers_in, NULL);
+ ap_table_unset(r->headers_in, "BackhandProxied");
strcat(header, "\n");

/* Get our socket */
--- END PATCH ---

--
Theo Schlossnagle
1024D/A8EBCF8F/13BD 8C08 6BE2 629A 527E 2DC2 72C2 AD05 A8EB CF8F
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7