[squid-users] I want to display indirect_client_address on error page.
Kazuhiro Asakura
asakura at ioc.dnp.co.jp
Thu Aug 6 05:27:48 UTC 2015
Thank you Amos,
From: Amos Jeffries <squid3 at treenet.co.nz>
> > I use "follow-x-forwarded-for" feature, and logged end point IP address.
> > Also, I created customized error page for end user. but, env %i of
> > error page does not be translate to end point IP address.
>
> More correctly it is the direct endpoint of the client TCP connection.
> Not the chain of multiple TCP connections, which may include NAT or
> other protocol translations between Squid and a user.
Sorry, My description not enough.
In this environment, BIG-IP exist between end point PC and Squid.
BIG-IP do NAT, and add X-FORWARDED-FOR header.
BIG-IP include IP address of endpoint PC for X-FORWARDED-FOR header.
So, I use follow-x-forwarded-for feature, and get endpoint PC IP address .
This time, endpoint PC IP address is written into Squid access.log.
Maybe, source code is below,
AccessLogEntry.cc
----
#if FOLLOW_X_FORWARDED_FOR
if (Config.onoff.log_uses_indirect_client && request)
log_ip = request->indirect_client_addr;
else
#endif
----
But, it is not assigned to environment variable of error page.
If environment variable of error page could support "indirect_client_addr",
I would really appreciate it.
> > I want to display the address of end point to error page.
> > If someone could suggest solution, I would really appreciate it.
>
> The easiest approach I think would be to add a javascript snippet in
> place of the %i code that locates the users IP address and displays it
> to them.
I feel that way is difficult.
Because, solution of javascript only works JScript, or require STUN server.
> > Sorry my poor English.
>
> Not a problem. Quite good compared to some.
I'm writing using Google translate.
I hope the feelings of my gratitude will reach you.
regards,
Kazuhiro
More information about the squid-users
mailing list