<?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>域名 &#8211; Lhy&#039;s blog</title>
	<atom:link href="https://blog.lhyshome.com/tag/%e5%9f%9f%e5%90%8d/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.lhyshome.com</link>
	<description>welcome</description>
	<lastBuildDate>Fri, 16 May 2025 06:21:33 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">219834889</site>	<item>
		<title>如何将内网的服务用域名访问</title>
		<link>https://blog.lhyshome.com/2024/07/25/192/</link>
					<comments>https://blog.lhyshome.com/2024/07/25/192/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Thu, 25 Jul 2024 01:47:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[内网穿透]]></category>
		<category><![CDATA[域名]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=192</guid>

					<description><![CDATA[本次所需 域名，云服务器（为了云服务器的公网IP），内网穿透工具。本贴域名与云服务器皆为阿里云系。云服务器安装… <span class="read-more"><a href="https://blog.lhyshome.com/2024/07/25/192/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">本次所需</h2>



<p>域名，云服务器（为了云服务器的公网IP），内网穿透工具。本贴域名与云服务器皆为阿里云系。云服务器安装nginx，和内网穿透工具服务端。</p>



<h2 class="wp-block-heading">部署操作</h2>



<h3 class="wp-block-heading">阿里云</h3>



<p class="has-text-align-left">在阿里云的云解析DNS上将已有二级域名（eg.： example.com）解析为三级域名（eg.：alist.example.com）方便后续操作。记录值设为已有云服务器公网IP地址。</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="300" src="https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-1024x300.png" alt="" class="wp-image-193" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-1024x300.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-300x88.png 300w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-768x225.png 768w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-1536x450.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-500x147.png 500w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-800x235.png 800w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-1280x375.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4-660x194.png 660w, https://blog.lhyshome.com/wp-content/uploads/2024/07/image-4.png 1910w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">内网穿透工具</h3>



<p>登录云服务器上部署的内网穿透工具后台，将内网的IP和端口映射到服务器上的具体某一端口。</p>



<p>eg.：将内网端口映射到服务器的8080端口</p>



<h3 class="wp-block-heading">云服务器</h3>



<p>在nginx里添加对应配置脚本，将nginx的80端口（或其他端口）代理到内网映射的对应端口上</p>



<pre class="wp-block-code"><code>upstream example {
    server 127.0.0.1:8080 ;
}

server {
    listen 80;
    server_name alist.example.com;
    location / {
       proxy_pass http://example;
    }
}</code></pre>



<h2 class="wp-block-heading">结束</h2>



<p>即可以通过访问alist.example.com域名可以访问到服务器的对应端口，再经由内网穿透工具访问到内网的具体服务上。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2024/07/25/192/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">192</post-id>	</item>
	</channel>
</rss>
