Skip to content

设置源服务器的Nginx使源服务器获取访客真实IP

操作

只需修改nginx的全局配置,增加这两行

# 设置源服务器的Nginx使源服务器获取访客真实IP
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;

试验

Leave a Reply

Your email address will not be published.