¡Ü X-Forwarded-For(XFF) Http Header.
¡Ü Apache Httpd 2.4 + WAS Á¶ÇÕ È¯°æ¿¡¼ mod_jk °¡ ¾Æ´Ñ, mod_proxy ¸¦ »ç¿ëÇÏ¿© WAS ¿Í ¿¬°áÇÏ´Â °æ¿ì.
- WAS ¿¡¼ request.getRemoveAddr() °á°ú°¡ ½ÇÁ¦ Ŭ¶óÀ̾ðÆ® IP °¡ ¾Æ´Ñ Apache Httpd ¼¹öÀÇ IP ·Î ȹµæµÈ´Ù.
- À̸¦ ÇØ°áÇϱâ À§ÇØ ¾Æ·¡ 2°¡Áö ÀÛ¾÷À» ÇØÁÖ¾î¾ß ÇÑ´Ù.
¨ç Apache httpd 2.4 ¿¡¼
XFF Header È°¼ºÈ (httpd.conf)
1) LoadModule remoteip_module modules/mod_remoteip.so ÁÖ¼® ÇØÁ¦
2) RemoteIPHeader X-Forwarded-For ¶óÀÎ Ãß°¡.
¨è WAS ÀÇ Java Äڵ忡¼ Ŭ¶óÀ̾ðÆ® ¾ÆÀÌÇÇ È¹µæ½Ã,
The answer of JasonW is fine.
But since apache httpd 2.4.6 there is a alternative: mod_remoteip
All what you must do is:
1. May be you must install the "mod_remoteip" package
2. Enable the module:
LoadModule remoteip_module modules/mod_remoteip.so
3. Add the following to your apache httpd config.
Note that you must add this line not into the configuration of the proxy server.
You must add this to the configuration of the proxy target httpd server (the server behind the proxy):
RemoteIPHeader X-Forwarded-For
See at http://httpd.apache.org/docs/trunk/mod/mod_remoteip.html for more informations and more options.
¡Ü Âü°í...
http://stackoverflow.com/questions/760283/apache-proxypass-how-to-preserve-original-ip-address
http://stackoverflow.com/questions/16558869/getting-ip-address-of-client
https://www.lesstif.com/pages/viewpage.action?pageId=20775886
|