惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

Rat's Blog - CDN

使用cdn-manager自建CDN服务器,支持处理图片/缓存视频等资源 - Rat's Blog 免费CDN系统:wdDNS_v3版本安装教程 - Rat's Blog 免费CDN系统:wdCDN2单节点版本安装教程 - Rat's Blog CloudFlare/Incapsula:不需要备案,免费的CND商家 - Rat's Blog
LNMP环境下使用CDN后获取访客真实IP的方法 - Rat's Blog
博主: Rat's · 2017-07-09 · via Rat's Blog - CDN

说明:很多时候为了加速网站快速访问都会上CDN,这样一来程序和nginx日志获取到的访客IP地址就是CDN的节点IP而不是用户的真实IP了,这时候可以通过设置Nginx下的ngx_realip的模块是可以解决这个问题的,一般这个模块是默认没有添加的,不过军哥的lnmp是有这个模块的,所以设置会简单很多,这里说下具体方法。

方法

以军哥的lnmp为例,只需要添加些参数即可!

1、在lnmp安装目录/root/lnmp下找到lnmp.conf并编辑Nginx_Modules_Options

Nginx_Modules_Options='--with-http_realip_module'

保存后执行./upgrade.sh nginx来升级下Nginx就可以了。

2、找到网站配置文件,即/usr/local/nginx/conf/vhost/xx.com.conf并编辑。在任意一个location里加入以下参数:

set_real_ip_from  103.138.13.10/34;
set_real_ip_from  107.63.132.0/29;
set_real_ip_from  108.62.120.0/26;
set_real_ip_from  45.113.252.0/26;
real_ip_header    X-Forwarded-For;
real_ip_recursive on;

以上的IP地址换成你使用的CDNIP地址段。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/204/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。