Weblogic - 了解访问日志的内容:c-ip 与 x-ClientIP
在 Weblogic 应用程序服务器上,我正在分析访问日志以计算有多少不同的客户端访问了该应用程序。我不确定这些日志中发现的这两列之间的区别: c-ip 和 x-ClientIP
有人可以解释一下并指出参考文档吗?我只找到“c-ip”作为日志格式字符串的用法...或者这些列名称是否特定于我的应用程序?
On a Weblogic app server I'm analysing the access logs to count how many distinct clients have accessed the app. I am not sure about the difference between these two columns found in these logs:
c-ip and x-ClientIP
Could somebody please explain and point to the reference docs? I am only finding usages of "c-ip" as a format string for logs... Or are these column names specific to my app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两者都显示客户端的 IP 地址。 x-ClientIP 可能与 clientip 相同,但它是在您的设备(负载均衡器或其他一些云设备,例如 WAF 或 CDN)上配置的,
“c-ip”显示客户端的 IP 地址。这很简单。
如果您直接访问Weblogic服务器,它将在日志文件中显示您PC的IP地址。
但是,如果您从负载均衡器访问 weblogic,则负载均衡器的 IP 地址将显示在日志文件中。那么如何显示客户端的IP地址呢?
输入 x-forwarded-for 或 x-clientIP 标头。这需要在负载均衡器/网络设备上进行特殊配置。配置完成后,即使您使用负载均衡器/网络设备访问客户端,也可以使用 x-clientIP 显示客户端的 IP 地址。
Both display the ip address of the client. x-ClientIP is probably the same as the clientip but its configured on your device (Load Balancer or some other cloud device say WAF or CDN)
"c-ip" displays the ip address of the client. This is straight foward.
If you access weblogic server directly, it will display your PC's ip address in the log files.
However, if you access weblogic from say a load balancer, the ip address of the load balancer will get displayed in the log files. How then do you display the ip address of the client ?
Enter x-forwarded-for or x-clientIP header. This requires special configuration on the load balancer/network device. Once configured, you can display the ip address of the client using say x-clientIP even if you are accessing it using a load balancer/network device.