您的位置:首页 > 其它

F5+weblogic 如何在weblogic的access.log中记录F5之前的应用ip?

2015-11-15 19:55 656 查看
场景介绍:

用户端------------>F5------------------>应用系统(weblogic应用服务器)

应用系统的access日志中记录的信息全部是F5的地址而非用户端的实际IP地址,

1、经过查找F5的资料,发现F5中有这样一个配置项:X-Forwarded-For,指向的是F5地址,导致access日志记录的是F5地址。另外,检查http
profile配置,将参数Insert X-Forwarded-For配置启用,F5会将用户的IP地址插入X-Forwarded-For 作为标头,才在weblogic的access日志中记录用户的实际IP地址。

2、登录weblogic控制台

第一步:

AdminConsole —> Servers —-> [Your_Server_Name] —> Configuration [Tab] —> General [Sub-Tab] —> 

- Click on “Advanced” Link 

- Check the CheckBox in this Page “WebLogic Plug-In Enabled” 

“WL-Proxy-Client-IP”

第二步:

Servers –> [YOUR_SERVER_NAME] —> Logging [Tab] —> HTTP [sub-tab] 

- Click on Advanced Link at the bottom of the page 

- In the “Extended Logging Format Fields:” Just add the
c-ip at the beginning or at the end of the values and save it. 

这里附上自定义日志字段的api:https://docs.oracle.com/cd/E13222_01/wls/docs81/adminguide/web_server.html#http_log

参考章节:Supported Field identifiers

第三步:

Servers -> [YOUR_SERVER_NAME] -> Protocols -> HTTP [sub-tab] 

-In the 'Remote Address Override' text box enter 'X-Forwarded-For' 

最后重启服务器!

转载请注明原创地址[http://write.blog.csdn.net/postedit/49851575],谢谢。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: