在需要获取真实IP的https隧道后加上proxy_protocol_version = v2,如图
proxy_protocol_version = v2
在https后加上 proxy_protocol之后在root后加上
proxy_protocol
real_ip_header proxy_protocol; real_ip_recursive on; set_real_ip_from 127.0.0.1;
最后重启nginx即可获取真实IP地址