Site updated: 2022-09-27 15:13:02

This commit is contained in:
qinglong
2022-09-27 15:13:02 +08:00
parent edf027ae42
commit 4fcf6f00cc
42 changed files with 311 additions and 41 deletions

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

View File

@ -8,7 +8,7 @@
<author>
<name>Hito li</name>
</author>
<updated>2022-09-26T11:30:00.000Z</updated>
<updated>2022-09-27T06:45:00.000Z</updated>
<category term="hito" />
<category term="無言" />
<category term="博客" />
@ -16,6 +16,103 @@
<category term="笔记" />
<category term="心得体会" />
<category term="踩坑" />
<entry>
<id>https://blog.jingxiyuan.cn/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/</id>
<title>nginx负载均衡配置</title>
<link rel="alternate" href="https://blog.jingxiyuan.cn/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/"/>
<content type="html">&lt;h2 id=&#34;nginx负载均衡配置&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#nginx负载均衡配置&#34;&gt;#&lt;/a&gt; nginx 负载均衡配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;轮询(默认)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
server 192.168.0.2:8080;
server 192.168.0.3:8080;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;weight 权重策略&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;weight 代表权重,默认为 1权重越高被分配的客户端越多指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
server 192.168.0.2:8080 weight=1;
server 192.168.0.3:8080 weight=2;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;ip_hash&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
ip_hash;
server 192.168.0.2:8080;
server 192.168.0.3:8080;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;fair (第三方)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;按后端服务器的响应时间来分配请求,响应时间短的优先分配。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
server 192.168.0.2:8080;
server 192.168.0.3:8080;
fair;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;5&#34;&gt;
&lt;li&gt;动静分离&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;把静态的资源比如图片cssjs 等先加载到 Nginx 的服务器里。&lt;/em&gt;&lt;/p&gt;
</content>
<category term="技术分享" scheme="https://blog.jingxiyuan.cn/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" />
<category term="nginx" scheme="https://blog.jingxiyuan.cn/tags/nginx/" />
<category term="负载均衡" scheme="https://blog.jingxiyuan.cn/tags/%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" />
<updated>2022-09-27T06:45:00.000Z</updated>
</entry>
<entry>
<id>https://blog.jingxiyuan.cn/2022/09/26/%E8%A7%A3%E5%86%B3Hexo-Shoka%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90%E6%97%A0%E6%B3%95%E6%92%AD%E6%94%BE%E7%9A%84%E9%97%AE%E9%A2%98/</id>
<title>解决Hexo+Shoka背景音乐无法播放的问题</title>

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

View File

@ -6,6 +6,18 @@
"description": "hito的博客",
"home_page_url": "https://blog.jingxiyuan.cn",
"items": [
{
"id": "https://blog.jingxiyuan.cn/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/",
"url": "https://blog.jingxiyuan.cn/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/",
"title": "nginx负载均衡配置",
"date_published": "2022-09-27T06:45:00.000Z",
"content_html": "<h2 id=\"nginx负载均衡配置\"><a class=\"anchor\" href=\"#nginx负载均衡配置\">#</a> nginx 负载均衡配置</h2>\n<ol>\n<li>轮询(默认)</li>\n</ol>\n<p><em>每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。</em></p>\n<pre><code class=\"language-yum\">upstream my_server &#123;\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n&#125;\n\nserver &#123;\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / &#123;\n\t\tproxy_pass http://my_server;\n\t&#125;\n\t\n&#125;\n</code></pre>\n<ol start=\"2\">\n<li>weight 权重策略</li>\n</ol>\n<p><em>weight 代表权重,默认为 1权重越高被分配的客户端越多指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。</em></p>\n<pre><code class=\"language-yum\">upstream my_server &#123;\n\tserver 192.168.0.2:8080 weight=1;\n\tserver 192.168.0.3:8080 weight=2;\n&#125;\n\nserver &#123;\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / &#123;\n\t\tproxy_pass http://my_server;\n\t&#125;\n\t\n&#125;\n</code></pre>\n<ol start=\"3\">\n<li>ip_hash</li>\n</ol>\n<p><em>每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。</em></p>\n<pre><code class=\"language-yum\">upstream my_server &#123;\n\tip_hash;\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n&#125;\n\nserver &#123;\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / &#123;\n\t\tproxy_pass http://my_server;\n\t&#125;\n\t\n&#125;\n</code></pre>\n<ol start=\"4\">\n<li>fair (第三方)</li>\n</ol>\n<p><em>按后端服务器的响应时间来分配请求,响应时间短的优先分配。</em></p>\n<pre><code class=\"language-yum\">upstream my_server &#123;\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n\tfair;\n&#125;\n\nserver &#123;\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / &#123;\n\t\tproxy_pass http://my_server;\n\t&#125;\n\t\n&#125;\n</code></pre>\n<ol start=\"5\">\n<li>动静分离</li>\n</ol>\n<p><em>把静态的资源比如图片cssjs 等先加载到 Nginx 的服务器里。</em></p>\n",
"tags": [
"技术分享",
"nginx",
"负载均衡"
]
},
{
"id": "https://blog.jingxiyuan.cn/2022/09/26/%E8%A7%A3%E5%86%B3Hexo-Shoka%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90%E6%97%A0%E6%B3%95%E6%92%AD%E6%94%BE%E7%9A%84%E9%97%AE%E9%A2%98/",
"url": "https://blog.jingxiyuan.cn/2022/09/26/%E8%A7%A3%E5%86%B3Hexo-Shoka%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90%E6%97%A0%E6%B3%95%E6%92%AD%E6%94%BE%E7%9A%84%E9%97%AE%E9%A2%98/",

File diff suppressed because one or more lines are too long

101
rss.xml
View File

@ -10,8 +10,8 @@
</author>
<description>hito的博客</description>
<language>zh-CN</language>
<pubDate>Mon, 26 Sep 2022 19:30:00 +0800</pubDate>
<lastBuildDate>Mon, 26 Sep 2022 19:30:00 +0800</lastBuildDate>
<pubDate>Tue, 27 Sep 2022 14:45:00 +0800</pubDate>
<lastBuildDate>Tue, 27 Sep 2022 14:45:00 +0800</lastBuildDate>
<category term="hito" />
<category term="無言" />
<category term="博客" />
@ -19,6 +19,103 @@
<category term="笔记" />
<category term="心得体会" />
<category term="踩坑" />
<item>
<guid isPermalink="true">https://blog.jingxiyuan.cn/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/</guid>
<title>nginx负载均衡配置</title>
<link>https://blog.jingxiyuan.cn/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/</link>
<category term="技术分享" scheme="https://blog.jingxiyuan.cn/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/" />
<category term="nginx" scheme="https://blog.jingxiyuan.cn/tags/nginx/" />
<category term="负载均衡" scheme="https://blog.jingxiyuan.cn/tags/%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" />
<pubDate>Tue, 27 Sep 2022 14:45:00 +0800</pubDate>
<description><![CDATA[ &lt;h2 id=&#34;nginx负载均衡配置&#34;&gt;&lt;a class=&#34;anchor&#34; href=&#34;#nginx负载均衡配置&#34;&gt;#&lt;/a&gt; nginx 负载均衡配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;轮询(默认)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
server 192.168.0.2:8080;
server 192.168.0.3:8080;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;weight 权重策略&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;weight 代表权重,默认为 1权重越高被分配的客户端越多指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
server 192.168.0.2:8080 weight=1;
server 192.168.0.3:8080 weight=2;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;ip_hash&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
ip_hash;
server 192.168.0.2:8080;
server 192.168.0.3:8080;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;fair (第三方)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;按后端服务器的响应时间来分配请求,响应时间短的优先分配。&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-yum&#34;&gt;upstream my_server &amp;#123;
server 192.168.0.2:8080;
server 192.168.0.3:8080;
fair;
&amp;#125;
server &amp;#123;
listen 80;
server_name 192.168.0.1;
# Path to the root of your installation
location / &amp;#123;
proxy_pass http://my_server;
&amp;#125;
&amp;#125;
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&#34;5&#34;&gt;
&lt;li&gt;动静分离&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;把静态的资源比如图片cssjs 等先加载到 Nginx 的服务器里。&lt;/em&gt;&lt;/p&gt;
]]></description>
</item>
<item>
<guid isPermalink="true">https://blog.jingxiyuan.cn/2022/09/26/%E8%A7%A3%E5%86%B3Hexo-Shoka%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90%E6%97%A0%E6%B3%95%E6%92%AD%E6%94%BE%E7%9A%84%E9%97%AE%E9%A2%98/</guid>
<title>解决Hexo+Shoka背景音乐无法播放的问题</title>

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