16 lines
643 B
Plaintext
16 lines
643 B
Plaintext
# 放到 nginx.conf 的 http {} 内(或 http 级 include)。
|
|
#
|
|
# 仅当与 nginx 建立连接的对端属于 EdgeOne 节点网段时,才采信
|
|
# EO-Connecting-IP;直连公网 EIP 的请求无法伪造该头。
|
|
#
|
|
# 网段清单 /etc/nginx/edgeone-ips.conf 由 update-edgeone-ips.sh 生成,
|
|
# 源数据从 EdgeOne 控制台或 API 导出(会变动,建议定期刷新)。
|
|
|
|
real_ip_header EO-Connecting-IP;
|
|
real_ip_recursive on;
|
|
|
|
include /etc/nginx/edgeone-ips.conf;
|
|
|
|
# 备选:用 EdgeOne 的 X-Forwarded-For(首段为真实客户端)配合网段递归提取。
|
|
# real_ip_header X-Forwarded-For;
|
|
# real_ip_recursive on; |