配置如下:
location / {
## set_real_ip_from 为上级代理ip
set_real_ip_from 10.0.0.0/8;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
## 白名单
allow 172.0.0.0/8;
deny all;
}
配置如下:
location / {
## set_real_ip_from 为上级代理ip
set_real_ip_from 10.0.0.0/8;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
## 白名单
allow 172.0.0.0/8;
deny all;
}
本文标题:nginx 基于x-forward-for做白名单
本文链接:https://www.haomeiwen.com/subject/ssxorftx.html
网友评论