The recent message about proxy_add_forward reminded me of a simple
change I made that might help anyone who wants to track the
logs matching the source/destination of proxied requests.
I also activated mod_unique_id and in mod_proxy_add_forward, after
if (r->proxyreq) {
ap_table_set(r->headers_in, "X-Forwarded-For",
r->connection->remote_ip);
I added: (too lazy to write a whole module for this...)
ap_table_set(r->headers_in, "X-Parent-Id",
ap_table_get(r->subprocess_env, "UNIQUE_ID")) ;
Then I added elements in the LogFormat for
%{UNIQUE_ID}e %{X-Parent-Id}i
The result is that the UNIQUE_ID field is different on every hit
and can be used as a database key. If the first server hit
delivers the content directly, the X-Parent-Id will be logged as
"-". If it passes the request by proxy to another server it will
be the same as the UNIQUE_ID (I wasn't expecting that, but it is
interesting). The machine that receives the proxy request will
log the X-Parent-Id containing the same value as the sender's
UNIQUE_ID which can then be used to tie them together.
Les Mikesell
[EMAIL PROTECTED]