谷姐:我们都是谷歌迷
We are all Google fans

套cf的话,怎么获取用户的真实ip呢?-斌斌

Rate this post

我后端获取的ip都是cf的ip。

热议
2楼 tkzc 11小时前

请求头里有真实IP

丢在伪静态里

4楼 shwish 10小时前

cf-connecting-ip就是真实ip
https://developers.cloudflare.com/fundamentals/get-started/reference/http-request-headers/

5楼 lonefly 10小时前

https://www.yunloc.com/647.html

6楼 mianfeizhujiwu2 9小时前

涨姿势,来学习下~

7楼 斌斌 1小时前

https://www.yunloc.com/647.html

方法2,我把代码添加到我/etc/nginx/nginx.conf 的http里面,重启出错,不能添加这个代码呢。

8楼 lonefly 1小时前

方法2,我把代码添加到我/etc/nginx/nginx.conf 的http里面,重启出错,不能添加这个代码呢。 ...

站点日志后面加上access

access_log /www/wwwlogs/yunloc.com.log access;

9楼 斌斌 半小时前

站点日志后面加上access

access_log /www/wwwlogs/yunloc.com.log access;

不是这个问题呢。是加了方法二的东西,重启nginx直接出错。
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

root@HZ1 ~ # systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-01-05 10:32:36 CST; 6s ago
Docs: man:nginx(8)
Process: 166235 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited,> CPU: 5ms

Jan 05 10:32:36 HZ1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Jan 05 10:32:36 HZ1 nginx[166235]: nginx: [emerg] pcre_compile() failed: unrecognized character after>Jan 05 10:32:36 HZ1 nginx[166235]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jan 05 10:32:36 HZ1 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jan 05 10:32:36 HZ1 systemd[1]: nginx.service: Failed with result 'exit-code'.
Jan 05 10:32:36 HZ1 systemd[1]: Failed to start A high performance web server and a reverse proxy ser>

申明:本文内容由网友收集分享,仅供学习参考使用。如文中内容侵犯到您的利益,请在文章下方留言,本站会第一时间进行处理。

未经谷姐允许不得转载:谷姐靓号网 » 套cf的话,怎么获取用户的真实ip呢?-斌斌
分享到: 生成海报

热门文章

评论 抢沙发

评论前必须登录!

立即登录   注册

买Google Voice认准【谷姐靓号网】

Google Voice靓号列表Google Voice自助购买
切换注册

登录

忘记密码 ?

切换登录

注册

我们将发送一封验证邮件至你的邮箱, 请正确填写以完成账号注册和激活