宝塔防火墙中本身有CDN设置,开启会识别请求头中信息,有安全问题。识别具体反向服务器IP,再通过提取头部转发IP,才妥当
/www/server/btwaf/httpd.lua
function get_client_ip() 最后面补充下列语句
if(client_ip=='反响代理服务器IP' and httpd.headers_in['x-forwarded-for']~= nil and httpd.headers_in['x-forwarded-for'] ~= "") then
client_ip= httpd.headers_in['x-forwarded-for'];
end |