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

推荐订阅源

WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cloudbric
Cloudbric
P
Palo Alto Networks Blog
T
Threatpost
T
Tor Project blog
T
Tenable Blog
AWS News Blog
AWS News Blog
Project Zero
Project Zero
L
LangChain Blog
Cyberwarzone
Cyberwarzone
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Latest
Security Latest
云风的 BLOG
云风的 BLOG
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
MongoDB | Blog
MongoDB | Blog
aimingoo的专栏
aimingoo的专栏
K
Kaspersky official blog
Jina AI
Jina AI
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
IT之家
IT之家
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
Y
Y Combinator 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个机房按小时计费,支持支付宝,【点击查看】。