简体   繁体   English

如何在Nginx代理中从UCbrowser中检测真实IP?

[英]How to detecting real IP from UCbrowser in Nginx proxy?

I have nginx proxy server and application on python. 我在python上有nginx代理服务器和应用程序。 When I got request from UCbrowser I see this headers 当我收到UCbrowser的请求时,我会看到此标头

HTTP_CLIENTIP': '223.176.141.141'
'HTTP_X_REAL_IP': '168.235.197.149'
'REMOTE_ADDR': '168.235.197.149'
'HTTP_X_FORWARDED_FOR': '223.176.141.141, 168.235.197.149'

Client ip is 223.176.141.141 but geoip detect wrong counry with ip 168.235.197.149... In config I have this options 客户端ip为223.176.141.141,但是geoip与ip 168.235.197.149一起检测到错误的密码...在配置中,我有此选项

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

and

  set_real_ip_from 192.168.1.0/24;  
  real_ip_header X-Forwarded-For;

How to solve that problem that real ip detecting normally? 如何解决真正的ip检测正常的问题?

Have you installed ngx_http_realip_module on your server with the nginx ? 您是否已使用Nginx在服务器上安装了ngx_http_realip_module?

http://nginx.org/en/docs/http/ngx_http_realip_module.html http://nginx.org/en/docs/http/ngx_http_realip_module.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM