Site updated: 2022-09-27 15:13:02
This commit is contained in:
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
63
2022/09/27/nginx负载均衡配置/index.html
Normal file
63
2022/09/27/nginx负载均衡配置/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
99
atom.xml
99
atom.xml
@ -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"><h2 id="nginx负载均衡配置"><a class="anchor" href="#nginx负载均衡配置">#</a> nginx 负载均衡配置</h2>
|
||||
<ol>
|
||||
<li>轮询(默认)</li>
|
||||
</ol>
|
||||
<p> <em>每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
server 192.168.0.2:8080;
|
||||
server 192.168.0.3:8080;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="2">
|
||||
<li>weight 权重策略</li>
|
||||
</ol>
|
||||
<p> <em>weight 代表权重,默认为 1,权重越高被分配的客户端越多,指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
server 192.168.0.2:8080 weight=1;
|
||||
server 192.168.0.3:8080 weight=2;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="3">
|
||||
<li>ip_hash</li>
|
||||
</ol>
|
||||
<p> <em>每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
ip_hash;
|
||||
server 192.168.0.2:8080;
|
||||
server 192.168.0.3:8080;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="4">
|
||||
<li>fair (第三方)</li>
|
||||
</ol>
|
||||
<p> <em>按后端服务器的响应时间来分配请求,响应时间短的优先分配。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
server 192.168.0.2:8080;
|
||||
server 192.168.0.3:8080;
|
||||
fair;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="5">
|
||||
<li>动静分离</li>
|
||||
</ol>
|
||||
<p> <em>把静态的资源,比如图片,css,js 等先加载到 Nginx 的服务器里。</em></p>
|
||||
</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
12
feed.json
12
feed.json
@ -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 {\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\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 {\n\tserver 192.168.0.2:8080 weight=1;\n\tserver 192.168.0.3:8080 weight=2;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\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 {\n\tip_hash;\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\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 {\n\tserver 192.168.0.2:8080;\n\tserver 192.168.0.3:8080;\n\tfair;\n}\n\nserver {\n\tlisten 80;\n\tserver_name 192.168.0.1;\n\n\t# Path to the root of your installation\n\tlocation / {\n\t\tproxy_pass http://my_server;\n\t}\n\t\n}\n</code></pre>\n<ol start=\"5\">\n<li>动静分离</li>\n</ol>\n<p> <em>把静态的资源,比如图片,css,js 等先加载到 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
101
rss.xml
@ -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[ <h2 id="nginx负载均衡配置"><a class="anchor" href="#nginx负载均衡配置">#</a> nginx 负载均衡配置</h2>
|
||||
<ol>
|
||||
<li>轮询(默认)</li>
|
||||
</ol>
|
||||
<p> <em>每个请求按时间顺序逐一分配到不同的后端服务器,如果后端服务器 down 掉,能自动剔除。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
server 192.168.0.2:8080;
|
||||
server 192.168.0.3:8080;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="2">
|
||||
<li>weight 权重策略</li>
|
||||
</ol>
|
||||
<p> <em>weight 代表权重,默认为 1,权重越高被分配的客户端越多,指定轮询几率。weight 和访问比率成正比,用于后端服务器性能不均的情况。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
server 192.168.0.2:8080 weight=1;
|
||||
server 192.168.0.3:8080 weight=2;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="3">
|
||||
<li>ip_hash</li>
|
||||
</ol>
|
||||
<p> <em>每个请求按访问 ip 的 hash 结果分配,这样每个访客固定访问一个后端服务器,可以解决 session 的问题。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
ip_hash;
|
||||
server 192.168.0.2:8080;
|
||||
server 192.168.0.3:8080;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="4">
|
||||
<li>fair (第三方)</li>
|
||||
</ol>
|
||||
<p> <em>按后端服务器的响应时间来分配请求,响应时间短的优先分配。</em></p>
|
||||
<pre><code class="language-yum">upstream my_server &#123;
|
||||
server 192.168.0.2:8080;
|
||||
server 192.168.0.3:8080;
|
||||
fair;
|
||||
&#125;
|
||||
|
||||
server &#123;
|
||||
listen 80;
|
||||
server_name 192.168.0.1;
|
||||
|
||||
# Path to the root of your installation
|
||||
location / &#123;
|
||||
proxy_pass http://my_server;
|
||||
&#125;
|
||||
|
||||
&#125;
|
||||
</code></pre>
|
||||
<ol start="5">
|
||||
<li>动静分离</li>
|
||||
</ol>
|
||||
<p> <em>把静态的资源,比如图片,css,js 等先加载到 Nginx 的服务器里。</em></p>
|
||||
]]></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
1
tags/负载均衡/index.html
Normal file
1
tags/负载均衡/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
Reference in New Issue
Block a user