<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/scripts/pretty-feed-v3.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:h="http://www.w3.org/TR/html4/"><channel><title>一路の数字花园</title><description>梦里花落知多少</description><link>https://astro-pure.js.org</link><item><title>hello-blog</title><link>https://astro-pure.js.org/blog/hello-blog</link><guid isPermaLink="true">https://astro-pure.js.org/blog/hello-blog</guid><description>Write your description here.</description><pubDate>Mon, 01 Jun 2026 18:21:28 GMT</pubDate><content:encoded>&lt;p&gt;Write your content here.&lt;/p&gt;</content:encoded><h:img src="undefined"/><enclosure url="undefined"/></item><item><title>fix-nginx-server-name-redirect</title><link>https://astro-pure.js.org/blog/fix-nginx-server-name-redirect</link><guid isPermaLink="true">https://astro-pure.js.org/blog/fix-nginx-server-name-redirect</guid><description>告别内外链误判！解析Nginx中$_SERVER[&apos;SERVER_NAME&apos;]因重定向域名顺序导致的返回值错误，手把手教你通过宝塔面板调整server_name配置，快速修复内外链判断问题。</description><pubDate>Sun, 18 May 2025 16:17:00 GMT</pubDate><content:encoded>&lt;p&gt;通常来说，网站会通过判断内容中的链接是内链（指向同一网站内其他页面的链接，即相同域名或在允许的域名列表中）还是外链（指向非本网站域名的链接，即域名不在白名单中）来采取不同的处理方式。在代码中，判断内外链的常见方法是：&lt;code&gt;$host = $_SERVER[&apos;SERVER_NAME&apos;];&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;然而，当使用 Nginx 服务器时，可能会出现 &lt;code&gt;$_SERVER[&apos;SERVER_NAME&apos;]&lt;/code&gt; 返回值不为预期的主机域名的情况，这是由于 Nginx 的重定向机制导致的。&lt;/p&gt;
&lt;p&gt;Nginx 允许为一个 URL 配置多个重定向域名（通过配置文件中的 &lt;em&gt;server_name&lt;/em&gt;），而 &lt;code&gt;$_SERVER[&apos;SERVER_NAME&apos;]&lt;/code&gt; 默认会返回 &lt;em&gt;server_name&lt;/em&gt; 列表中的第一个值。如果该值是重定向域名而非目标域名，就会导致匹配错误。&lt;/p&gt;
&lt;p&gt;解决办法：调整 Nginx 配置文件中 &lt;em&gt;server_name&lt;/em&gt; 的值顺序，将目标域名置于首位，重定向域名移至其后。&lt;/p&gt;
&lt;p&gt;下面以 宝塔 +Nginx 为例：&lt;/p&gt;</content:encoded><h:img src="undefined"/><enclosure url="undefined"/></item></channel></rss>