FAQ

Page Discussion Edit History

NginxChsHttpRealIpModule

Revision as of 06:14, 27 October 2010 by Nyqxmfj (Talk)

(diff) 鈫 Older revision | Latest revision (diff) | Newer revision 鈫 (diff)

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鍦板潃澶磋浆鍙戞浛鎹娇鐢ㄣ

[edit] 鍙傝冩枃鐚

Original Documentation