Site updated: 2023-10-29 20:52:18
This commit is contained in:
parent
87dd1ef1be
commit
bfbf5a7afd
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
2023/10/29/给我的老笔记本清理灰尘/index.html
Normal file
1
2023/10/29/给我的老笔记本清理灰尘/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
55
atom.xml
55
atom.xml
@ -8,7 +8,7 @@
|
||||
<author>
|
||||
<name>Hito Li</name>
|
||||
</author>
|
||||
<updated>2023-10-28T11:56:00.000Z</updated>
|
||||
<updated>2023-10-29T12:41:00.000Z</updated>
|
||||
<category term="hito" />
|
||||
<category term="無言" />
|
||||
<category term="博客" />
|
||||
@ -17,6 +17,25 @@
|
||||
<category term="心得体会" />
|
||||
<category term="技术分享" />
|
||||
<category term="踩坑" />
|
||||
<entry>
|
||||
<id>https://hitoli.com/2023/10/29/%E7%BB%99%E6%88%91%E7%9A%84%E8%80%81%E7%AC%94%E8%AE%B0%E6%9C%AC%E6%B8%85%E7%90%86%E7%81%B0%E5%B0%98/</id>
|
||||
<title>给我的老笔记本清理灰尘</title>
|
||||
<link rel="alternate" href="https://hitoli.com/2023/10/29/%E7%BB%99%E6%88%91%E7%9A%84%E8%80%81%E7%AC%94%E8%AE%B0%E6%9C%AC%E6%B8%85%E7%90%86%E7%81%B0%E5%B0%98/"/>
|
||||
<content type="html"><p>今天闲着无事就把我的老笔记本拆了,清理了一下灰尘。笔记本已经 10 多年了,中间加过内存,换过固态硬盘。清理一下还能发挥它的余热!<br />
|
||||
<img data-src="https://nas.hitoli.com:18014/images/2023/10/29/c7b84a3d703a.jpg" alt="" /><br />
|
||||
<img data-src="https://nas.hitoli.com:18014/images/2023/10/29/fd2e099d875d.jpg" alt="" /><br />
|
||||
<img data-src="https://nas.hitoli.com:18014/images/2023/10/29/0fea7641ccde.jpg" alt="" /><br />
|
||||
<img data-src="https://nas.hitoli.com:18014/images/2023/10/29/73c63c1438a8.jpg" alt="" /><br />
|
||||
<img data-src="https://nas.hitoli.com:18014/images/2023/10/29/4c5d526af3e7.jpg" alt="" /><br />
|
||||
<img data-src="https://nas.hitoli.com:18014/images/2023/10/29/4b9bcbecbca3.jpg" alt="" /><br />
|
||||
<img data-src="https://nas.hitoli.com:18014/images/2023/10/29/38ffc2e9639f.jpg" alt="" /></p>
|
||||
</content>
|
||||
<category term="生活" scheme="https://hitoli.com/categories/%E7%94%9F%E6%B4%BB/" />
|
||||
<category term="日常记录" scheme="https://hitoli.com/categories/%E7%94%9F%E6%B4%BB/%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/" />
|
||||
<category term="笔记本" scheme="https://hitoli.com/tags/%E7%AC%94%E8%AE%B0%E6%9C%AC/" />
|
||||
<category term="DELL" scheme="https://hitoli.com/tags/DELL/" />
|
||||
<updated>2023-10-29T12:41:00.000Z</updated>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>https://hitoli.com/2023/10/28/Windows%E4%B8%8B%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE%E7%9A%84%E6%89%B9%E5%A4%84%E7%90%86/</id>
|
||||
<title>Windows下快速部署SpringBoot项目的批处理</title>
|
||||
@ -637,38 +656,4 @@ Lombok supports: OpenJDK javac, ECJ</p>
|
||||
<category term="Tengine" scheme="https://hitoli.com/tags/Tengine/" />
|
||||
<updated>2022-11-30T09:05:00.000Z</updated>
|
||||
</entry>
|
||||
<entry>
|
||||
<id>https://hitoli.com/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/</id>
|
||||
<title>Nginx动态解析域名方案</title>
|
||||
<link rel="alternate" href="https://hitoli.com/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/"/>
|
||||
<content type="html"><h4 id="应用场景"><a class="anchor" href="#应用场景">#</a> 应用场景:</h4>
|
||||
<p>由于有时候 nginx 代理的时候,第三方域名对应的 ip 可能发生变化,然而没有提前通知,然而如果不配置什么,nginx 又不能智能解析,因此 nginx 动态解析域名就比较重要。</p>
|
||||
<h4 id="使用模块nginx-upstream-dynamic-servers"><a class="anchor" href="#使用模块nginx-upstream-dynamic-servers">#</a> 使用模块 nginx-upstream-dynamic-servers</h4>
|
||||
<p>该模块在启动 nginx 的时候会对域名进行一次解析,解析完成后,在 DNS 服务器设定的 TTL 过期时间内不会再次更新,在 TTL 过期后则会再次发起域名解析请求更新域名所对应的 IP 地址。</p>
|
||||
<p>需要在 nginx 的配置文件中的 http 配置域内指定使用的 DNS 服务器,在 upstream 中需要进行域名解析的 server 后面添加 resolve 参数。</p>
|
||||
<p>例:</p>
|
||||
<figure class="highlight yaml"><figcaption data-lang="YAML"></figcaption><table><tr><td data-num="1"></td><td><pre>http <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre> resolver ip;</pre></td></tr><tr><td data-num="4"></td><td><pre></pre></td></tr><tr><td data-num="5"></td><td><pre> upstream test <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre> server www.xxx.com<span class="token punctuation">:</span>8080 resolve;</pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="10"></td><td><pre></pre></td></tr><tr><td data-num="11"></td><td><pre> server <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="12"></td><td><pre></pre></td></tr><tr><td data-num="13"></td><td><pre> listen 8080;</pre></td></tr><tr><td data-num="14"></td><td><pre></pre></td></tr><tr><td data-num="15"></td><td><pre> client_body_buffer_size 10m;</pre></td></tr><tr><td data-num="16"></td><td><pre></pre></td></tr><tr><td data-num="17"></td><td><pre> server_name localhost;</pre></td></tr><tr><td data-num="18"></td><td><pre></pre></td></tr><tr><td data-num="19"></td><td><pre> location / <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="20"></td><td><pre> </pre></td></tr><tr><td data-num="21"></td><td><pre> proxy_pass http<span class="token punctuation">:</span>//test;</pre></td></tr><tr><td data-num="22"></td><td><pre> </pre></td></tr><tr><td data-num="23"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="24"></td><td><pre> </pre></td></tr><tr><td data-num="25"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="26"></td><td><pre></pre></td></tr><tr><td data-num="27"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr></table></figure><p>缺点:</p>
|
||||
<p>1、每次解析域名之后,会从 DNS 服务器获取到改 DNS 的 TTL,在 TTL 期限内不会再次解析,所以如果目标域名发生改变,nginx 不会更新解析,知道 TTL 过期。</p>
|
||||
<p>2、DNS 服务器在 http 配置域配置全,不能在 location 中细分指定。</p>
|
||||
<h4 id="使用模块ngx_upstream_jdomain"><a class="anchor" href="#使用模块ngx_upstream_jdomain">#</a> 使用模块 ngx_upstream_jdomain</h4>
|
||||
<p>在 http 配置域中配置 DNS 服务器,在 upstream 中按照这个模块的格式配置,支持设置每隔多少秒进行一次解析(抓包分析过设置 interval 可指定解析间隔),如果解析失败则使用缓存中的上一次解析结果的 IP 地址访问。</p>
|
||||
<p>例:</p>
|
||||
<figure class="highlight yaml"><figcaption data-lang="YAML"></figcaption><table><tr><td data-num="1"></td><td><pre>http <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre> resolver ip;</pre></td></tr><tr><td data-num="4"></td><td><pre></pre></td></tr><tr><td data-num="5"></td><td><pre> upstream test <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre> jdomain www.xxx.com port=8080 interval=10; <span class="token comment">#指定域名和端口,每隔 10 秒进行一次解析</span></pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="10"></td><td><pre></pre></td></tr><tr><td data-num="11"></td><td><pre> server <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="12"></td><td><pre></pre></td></tr><tr><td data-num="13"></td><td><pre> listen 8080;</pre></td></tr><tr><td data-num="14"></td><td><pre></pre></td></tr><tr><td data-num="15"></td><td><pre> client_body_buffer_size 10m;</pre></td></tr><tr><td data-num="16"></td><td><pre></pre></td></tr><tr><td data-num="17"></td><td><pre> server_name localhost;</pre></td></tr><tr><td data-num="18"></td><td><pre></pre></td></tr><tr><td data-num="19"></td><td><pre> location / <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="20"></td><td><pre></pre></td></tr><tr><td data-num="21"></td><td><pre> proxy_pass http<span class="token punctuation">:</span>//test;</pre></td></tr><tr><td data-num="22"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="23"></td><td><pre> </pre></td></tr><tr><td data-num="24"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="25"></td><td><pre></pre></td></tr><tr><td data-num="26"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr></table></figure><p>缺点:DNS 服务器只能在 http 配域中全局配置</p>
|
||||
<h4 id="原生nginx使用set命令使用变量"><a class="anchor" href="#原生nginx使用set命令使用变量">#</a> 原生 nginx 使用 set 命令使用变量</h4>
|
||||
<p>将域名置于变量中,在对 proxy_pass 进行转发的时候域名调用变量,可以按照 valid,设置的时间参数间隔地对变量中的域名进行解析。</p>
|
||||
<p>例:</p>
|
||||
<figure class="highlight yaml"><figcaption data-lang="YAML"></figcaption><table><tr><td data-num="1"></td><td><pre>server <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre> listen 8080;</pre></td></tr><tr><td data-num="4"></td><td><pre></pre></td></tr><tr><td data-num="5"></td><td><pre> client_body_buffer_size 10m;</pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre> server_name localhost;</pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre> location / <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="10"></td><td><pre></pre></td></tr><tr><td data-num="11"></td><td><pre> resolver ip valid=3s;</pre></td></tr><tr><td data-num="12"></td><td><pre></pre></td></tr><tr><td data-num="13"></td><td><pre> set $five "www.xxx.com<span class="token punctuation">:</span>8080";</pre></td></tr><tr><td data-num="14"></td><td><pre></pre></td></tr><tr><td data-num="15"></td><td><pre> proxy_pass http<span class="token punctuation">:</span>//$<span class="token punctuation">&#123;</span>five<span class="token punctuation">&#125;</span>;</pre></td></tr><tr><td data-num="16"></td><td><pre></pre></td></tr><tr><td data-num="17"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="18"></td><td><pre> </pre></td></tr><tr><td data-num="19"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr></table></figure><p>缺点:upstream 中不支持设置变量,因此后端有多台的时候该方案不可行。</p>
|
||||
<h4 id="tengine"><a class="anchor" href="#tengine">#</a> Tengine</h4>
|
||||
<p>在 upstream 中配置 dynamic_resolve,在 location 配置域中指定 NDS 服务器,按照 valid 设置的时间间隔地进行地址解析。<span class="label danger">只支持 http 模块的动态域名解析</span></p>
|
||||
<p>例:</p>
|
||||
<figure class="highlight yaml"><figcaption data-lang="YAML"></figcaption><table><tr><td data-num="1"></td><td><pre>http <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="2"></td><td><pre></pre></td></tr><tr><td data-num="3"></td><td><pre> upstream test <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="4"></td><td><pre></pre></td></tr><tr><td data-num="5"></td><td><pre> dynamic_resolve fallback=stale fail_timeout=30s;</pre></td></tr><tr><td data-num="6"></td><td><pre></pre></td></tr><tr><td data-num="7"></td><td><pre> server www.xxx.com<span class="token punctuation">:</span>8080;</pre></td></tr><tr><td data-num="8"></td><td><pre></pre></td></tr><tr><td data-num="9"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="10"></td><td><pre></pre></td></tr><tr><td data-num="11"></td><td><pre> server <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="12"></td><td><pre></pre></td></tr><tr><td data-num="13"></td><td><pre> listen 8080;</pre></td></tr><tr><td data-num="14"></td><td><pre></pre></td></tr><tr><td data-num="15"></td><td><pre> location / <span class="token punctuation">&#123;</span></pre></td></tr><tr><td data-num="16"></td><td><pre></pre></td></tr><tr><td data-num="17"></td><td><pre> resolver ip valid=3s;</pre></td></tr><tr><td data-num="18"></td><td><pre></pre></td></tr><tr><td data-num="19"></td><td><pre> proxy_pass http<span class="token punctuation">:</span>//test;</pre></td></tr><tr><td data-num="20"></td><td><pre></pre></td></tr><tr><td data-num="21"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="22"></td><td><pre></pre></td></tr><tr><td data-num="23"></td><td><pre> <span class="token punctuation">&#125;</span></pre></td></tr><tr><td data-num="24"></td><td><pre></pre></td></tr><tr><td data-num="25"></td><td><pre><span class="token punctuation">&#125;</span></pre></td></tr></table></figure><p>缺点:需要将 nginx 的 bin 文件替换为 tengine 的 bin 文件。</p>
|
||||
</content>
|
||||
<category term="Linux" scheme="https://hitoli.com/categories/Linux/" />
|
||||
<category term="服务" scheme="https://hitoli.com/categories/Linux/%E6%9C%8D%E5%8A%A1/" />
|
||||
<category term="Nginx" scheme="https://hitoli.com/categories/Linux/%E6%9C%8D%E5%8A%A1/Nginx/" />
|
||||
<category term="Nginx" scheme="https://hitoli.com/tags/Nginx/" />
|
||||
<category term="Tengine" scheme="https://hitoli.com/tags/Tengine/" />
|
||||
<category term="动态域名解析" scheme="https://hitoli.com/tags/%E5%8A%A8%E6%80%81%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90/" />
|
||||
<updated>2022-11-30T08:35:00.000Z</updated>
|
||||
</entry>
|
||||
</feed>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
categories/生活/日常记录/index.html
Normal file
1
categories/生活/日常记录/index.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user