NginxChsHttpRealIpModule
Contents |
[edit] HttpRealIpModule妯″潡绠浠
杩欎釜妯″潡鍏佽浠庤姹侶eaders閲屾洿鏀瑰鎴风鐨処P鍦板潃鍊硷紙渚嬪 瀹炴椂鐨勮浆鍙戯級銆
瀹冩槸鏈夌敤鐨勶紝濡傛灉nginx鍚庨潰鏈夊灞傝礋杞藉潎琛/浠g悊锛宯ginx杞彂璇锋眰鏃跺皢浼氭坊鍔犳坊鍔犲鎴风鐨処P澶淬
杩欎釜妯″潡鏄笉鏄缓绔嬪湪榛樿鎯呭喌涓嬶紝闇瑕佽繖鏍峰惎鐢ㄥ畠
--with-http_realip_module
鐢ㄦ埛璇勮锛氣滀綘灏嗗缓绔嬩竴涓煎緱淇¤禆鐨勪唬鐞嗗垪琛紙瑙佷笅鏂囷級鍜屽鎴风鐨処P绗竴涓狪P澶翠腑鐨勪俊浠绘槸涓嶆槸浼氳浣跨敤銆傗 鏉ユ簮锛氭ā鍧楁槸Apache鑷堪 mod_extract 銆 淇℃伅鍗佸垎涓板瘜锛屼负浠涔堜互鍙婂浣曞畨鍏ㄥ姛鑳芥槸寰堟湁甯姪鐨勩
渚嬪
set_real_ip_from 192.168.1.0/24; set_real_ip_from 192.168.2.1; real_ip_header X-Real-IP;
[edit] 鎸囦护
[edit] set_real_ip_from
璇硶: set_real_ip_from [the address|CIDR]
榛樿鍊: 鏃
浣滅敤鍩: http, server, location
姝ゆ寚浠ゆ弿杩颁簡鍊煎緱淇¤禆鐨勫湴鍧锛岃繖鍙互璁﹏ginx鏇村噯纭殑鏇挎崲鍦板潃銆
[edit] real_ip_header
璇硶: real_ip_header [X-Real-IP|X-Forwarded-For]
榛樿鍊: real_ip_header X-Real-IP
浣滅敤鍩: http, server, location
姝ゆ寚浠よ缃簡IP鍦板潃澶磋浆鍙戞浛鎹娇鐢ㄣ