<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>百度CDN &#8211; 科技改变生活-雨落星辰</title>
	<atom:link href="https://p1e.cn/html/tag/%E7%99%BE%E5%BA%A6cdn/feed" rel="self" type="application/rss+xml" />
	<link>https://p1e.cn</link>
	<description>所有的伟大,都源于一个勇敢的开始</description>
	<lastBuildDate>Wed, 22 Mar 2023 09:17:39 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>Nginx服务器接入百度云加速CDN后如何获取真实访客IP？</title>
		<link>https://p1e.cn/html/3400.html</link>
					<comments>https://p1e.cn/html/3400.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Wed, 22 Mar 2023 09:17:39 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[百度CDN]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=3400</guid>

					<description><![CDATA[默认情况下，开启百度云加速CDN后，网站日志的请求IP只会显示 百度CDN的代理节点。 但有些站长是需要查看访客真实IP，所以今天教大家如何获取真实用户IP。 百度云加速转发的HTTP头信息中增加 X-Forwarded-For 信息，用于记录客户端的真实IP，所以我们只要修改服务器配置就行， Nginx获取真实IP的方法: 原理:使用Nginx自带的Realip模块获取用户真实IP 修改nginx配置:http{}中添加如下: set_real_ip_from 0.0.0.0/0; real_ip_header]]></description>
										<content:encoded><![CDATA[<p>默认情况下，开启<b>百度云加速</b>CDN后，网站日志的请求IP只会显示 百度CDN的代理节点。</p>
<p>但有些站长是需要查看访客真实IP，所以今天教大家如何获取真实用户IP。</p>
<p>百度云加速转发的HTTP头信息中增加 X-Forwarded-For 信息，用于记录客户端的真实IP，所以我们只要修改服务器配置就行，</p>
<p><b>Nginx</b>获取真实IP的方法:<br />
原理:使用Nginx自带的Realip模块获取用户真实IP<br />
修改nginx配置:http{}中添加如下:</p>
<pre>
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For; 
</pre>
<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" class="lazy entered loaded alignnone size-full wp-image-3401" title="Nginx服务器接入百度云加速CDN后如何获取真实访客IP？插图" src="https://i.p1e.cn/2023/03/blog20230322171618h2dQM6.jpg" alt="Nginx服务器接入百度云加速CDN后如何获取真实访客IP？插图" width="535" height="302" /></figure>
<p>然生重载 Nginx 配置完成！</p>
<figure class="wp-block-image size-full"><img decoding="async" class="lazy entered loaded alignnone size-full wp-image-3402" title="Nginx服务器接入百度云加速CDN后如何获取真实访客IP？插图1" src="https://i.p1e.cn/2023/03/blog202303221716213L7Sey.png" alt="Nginx服务器接入百度云加速CDN后如何获取真实访客IP？插图1" width="1010" height="833" /></figure>
<p>测试访问网站后，查看日志，已显示真实IP，就是这么简单！</p>
<figure class="wp-block-image size-full"><img decoding="async" class="lazy entered loaded alignnone size-full wp-image-3403" title="Nginx服务器接入百度云加速CDN后如何获取真实访客IP？插图2" src="https://i.p1e.cn/2023/03/blog20230322171624ZGTLUs.png" alt="Nginx服务器接入百度云加速CDN后如何获取真实访客IP？插图2" width="821" height="363" /></figure>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/3400.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
