chaitin / SafeLine

A web security gateway, serve as a reverse proxy to protect your websites from attacks and exploits.
https://waf.chaitin.com
GNU General Public License v3.0
10.87k stars 650 forks source link

攻击事件中的攻击IP是127.0.0.1的问题 #949

Closed ckgmg closed 1 week ago

ckgmg commented 1 week ago

问题描述

waf前端是NG,在NG上配置了,但是在攻击IP中还是显示127.0.0.1,并未显示源IP set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; real_ip_recursive on; location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://myapp;

版本号

6.1.3

复现方法

1

期望的结果

1

Lorna0 commented 1 week ago

官方技术文档中有介绍,搜源 ip 即可。waf 上显示 ip 不对的话得配置 waf,只改前面 nginx 不够。