This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 7571df5 Deploy to GitHub pages
7571df5 is described below
commit 7571df5ecf4a9b7d829f3ac22a740acb4fa5e0c4
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Nov 28 09:04:20 2020 +0000
Deploy to GitHub pages
---
apisix/README.html | 1 +
apisix/README/index.html | 1 +
apisix/debug-function.html | 153 +++++++++++++++++++++++++++++++++
apisix/debug-function/index.html | 153 +++++++++++++++++++++++++++++++++
apisix/zh-cn/README.html | 1 +
apisix/zh-cn/README/index.html | 1 +
apisix/zh-cn/debug-function.html | 147 +++++++++++++++++++++++++++++++
apisix/zh-cn/debug-function/index.html | 147 +++++++++++++++++++++++++++++++
sitemap.xml | 2 +-
9 files changed, 605 insertions(+), 1 deletion(-)
diff --git a/apisix/README.html b/apisix/README.html
index 46a714c..fcda96d 100644
--- a/apisix/README.html
+++ b/apisix/README.html
@@ -41,6 +41,7 @@
<li><a href="../CHANGELOG.md">Changelog</a></li>
<li><a href="/apisix/benchmark">Benchmark</a></li>
<li><a href="../CODE_STYLE.md">Code Style</a></li>
+<li><a href="/apisix/debug-function">Debug Function</a></li>
<li><a href="../FAQ.md">FAQ</a></li>
</ul>
<h2><a class="anchor" aria-hidden="true" id="plugins"></a><a href="#plugins"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1- [...]
diff --git a/apisix/README/index.html b/apisix/README/index.html
index 46a714c..fcda96d 100644
--- a/apisix/README/index.html
+++ b/apisix/README/index.html
@@ -41,6 +41,7 @@
<li><a href="../CHANGELOG.md">Changelog</a></li>
<li><a href="/apisix/benchmark">Benchmark</a></li>
<li><a href="../CODE_STYLE.md">Code Style</a></li>
+<li><a href="/apisix/debug-function">Debug Function</a></li>
<li><a href="../FAQ.md">FAQ</a></li>
</ul>
<h2><a class="anchor" aria-hidden="true" id="plugins"></a><a href="#plugins"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1- [...]
diff --git a/apisix/debug-function.html b/apisix/debug-function.html
new file mode 100644
index 0000000..9e672aa
--- /dev/null
+++ b/apisix/debug-function.html
@@ -0,0 +1,153 @@
+<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta
http-equiv="X-UA-Compatible" content="IE=edge"/><title>apisix/debug-function ·
Apache APISIX™</title><meta name="viewport" content="width=device-width"/><meta
name="generator" content="Docusaurus"/><meta name="description"
content="<!--"/><meta name="docsearch:language" content="en"/><meta
property="og:title" content="apisix/debug-function · Apache APISIX™"/><meta
property="og:type" content="website"/><meta property="og [...]
+ document.addEventListener('DOMContentLoaded', function() {
+ addBackToTop(
+ {"zIndex":100}
+ )
+ });
+ </script><script src="/js/scrollSpy.js"></script><link
rel="stylesheet" href="/css/main.css"/><script
src="/js/codetabs.js"></script></head><body class="sideNavVisible
separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper
wrapper"><header><a href="/"><img class="logo" src="/img/logo.png" alt="Apache
APISIX™"/><h2 class="headerTitleWithLogo">Apache APISIX™</h2></a><div
class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul
class="nav-site n [...]
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+<p><a href="/apisix/zh-cn/debug-function">Chinese</a></p>
+<h2><a class="anchor" aria-hidden="true" id="5xx-response-status-code"></a><a
href="#5xx-response-status-code" aria-hidden="true" class="hash-link"><svg
class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0
0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2
3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4
9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-. [...]
+<p>Similar <code>5xx</code> status codes such as 500, 502, 503, etc., are the
status codes in response to a server error. When a request has a
<code>5xx</code> status code; it may come from <code>APISIX</code> or
<code>Upstream</code>. How to identify the source of these response status
codes is a very meaningful thing. It can quickly help us determine the
problem.</p>
+<h2><a class="anchor" aria-hidden="true"
id="how-to-identify-the-source-of-the-5xx-response-status-code"></a><a
href="#how-to-identify-the-source-of-the-5xx-response-status-code"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 [...]
+<p>In the response header of the request, through the response header of
<code>X-APISIX-Upstream-Status</code>, we can effectively identify the source
of the <code>5xx</code> status code. When the <code>5xx</code> status code
comes from <code>Upstream</code>, the response header
<code>X-APISIX-Upstream-Status</code> can be seen in the response header, and
the value of this response header is the response status code. When the
<code>5xx</code> status code is derived from <code>APISIX</cod [...]
+<h2><a class="anchor" aria-hidden="true" id="example"></a><a href="#example"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1- [...]
+<blockquote>
+<p>Example 1: <code>502</code> response status code comes from
<code>Upstream</code> (IP address is not available)</p>
+</blockquote>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "methods": ["GET"],
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1": 1
+ },
+ "type": "roundrobin"
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>Test:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 14:40:22 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+
+</code></pre>
+<p>It has a response header of <code>X-APISIX-Upstream-Status: 502</code>.</p>
+<blockquote>
+<p>Example 2: <code>502</code> response status code comes from
<code>APISIX</code></p>
+</blockquote>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "plugins": {
+ "fault-injection": {
+ "abort": {
+ "http_status": 500,
+ "body": "Fault Injection!\n"
+ }
+ }
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>Test:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 500 Internal Server Error
+< Date: Wed, 25 Nov 2020 14:50:20 GMT
+< Content-Type: text/plain; charset=utf-8
+< Transfer-Encoding: chunked
+< Connection: keep-alive
+< Server: APISIX/2.0
+<
+Fault Injection!
+</code></pre>
+<p>There is no response header for <code>X-APISIX-Upstream-Status</code>.</p>
+<blockquote>
+<p>Example 3: <code>Upstream</code> has multiple nodes, and all nodes are
unavailable</p>
+</blockquote>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/upstreams/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "nodes": {
+ "127.0.0.3:1": 1,
+ "127.0.0.2:1": 1,
+ "127.0.0.1:1": 1
+ },
+ "retries": 2,
+ "type": "roundrobin"
+}'
+</code></pre>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "uri": "/hello",
+ "upstream_id": "1"
+}'
+</code></pre>
+<p>Test:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 15:07:34 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502, 502, 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+</code></pre>
+<p>It has a response header of <code>X-APISIX-Upstream-Status: 502, 502,
502</code>.</p>
+</span></div></article></div><div class="docs-prevnext"></div></div></div><nav
class="onPageNav"><ul class="toc-headings"><li><a
href="#5xx-response-status-code"><code>5xx</code> response status
code</a></li><li><a
href="#how-to-identify-the-source-of-the-5xx-response-status-code">How to
identify the source of the <code>5xx</code> response status code</a></li><li><a
href="#example">Example</a></li></ul></nav></div><footer class="nav-footer"
id="footer"><section class="sitemap"><a href="/ [...]
+ document.addEventListener('keyup', function(e) {
+ if (e.target !== document.body) {
+ return;
+ }
+ // keyCode for '/' (slash)
+ if (e.keyCode === 191) {
+ const search =
document.getElementById('search_input_react');
+ search && search.focus();
+ }
+ });
+ </script><script>
+ var search = docsearch({
+ appId: 'ZHVP417Y1Y',
+ apiKey: '79e72fedcf3719ba85c552f710ade8a3',
+ indexName: 'apache-apisix-website',
+ inputSelector: '#search_input_react'
+ });
+ </script></body></html>
\ No newline at end of file
diff --git a/apisix/debug-function/index.html b/apisix/debug-function/index.html
new file mode 100644
index 0000000..9e672aa
--- /dev/null
+++ b/apisix/debug-function/index.html
@@ -0,0 +1,153 @@
+<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta
http-equiv="X-UA-Compatible" content="IE=edge"/><title>apisix/debug-function ·
Apache APISIX™</title><meta name="viewport" content="width=device-width"/><meta
name="generator" content="Docusaurus"/><meta name="description"
content="<!--"/><meta name="docsearch:language" content="en"/><meta
property="og:title" content="apisix/debug-function · Apache APISIX™"/><meta
property="og:type" content="website"/><meta property="og [...]
+ document.addEventListener('DOMContentLoaded', function() {
+ addBackToTop(
+ {"zIndex":100}
+ )
+ });
+ </script><script src="/js/scrollSpy.js"></script><link
rel="stylesheet" href="/css/main.css"/><script
src="/js/codetabs.js"></script></head><body class="sideNavVisible
separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper
wrapper"><header><a href="/"><img class="logo" src="/img/logo.png" alt="Apache
APISIX™"/><h2 class="headerTitleWithLogo">Apache APISIX™</h2></a><div
class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul
class="nav-site n [...]
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+<p><a href="/apisix/zh-cn/debug-function">Chinese</a></p>
+<h2><a class="anchor" aria-hidden="true" id="5xx-response-status-code"></a><a
href="#5xx-response-status-code" aria-hidden="true" class="hash-link"><svg
class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0
0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2
3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4
9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-. [...]
+<p>Similar <code>5xx</code> status codes such as 500, 502, 503, etc., are the
status codes in response to a server error. When a request has a
<code>5xx</code> status code; it may come from <code>APISIX</code> or
<code>Upstream</code>. How to identify the source of these response status
codes is a very meaningful thing. It can quickly help us determine the
problem.</p>
+<h2><a class="anchor" aria-hidden="true"
id="how-to-identify-the-source-of-the-5xx-response-status-code"></a><a
href="#how-to-identify-the-source-of-the-5xx-response-status-code"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 [...]
+<p>In the response header of the request, through the response header of
<code>X-APISIX-Upstream-Status</code>, we can effectively identify the source
of the <code>5xx</code> status code. When the <code>5xx</code> status code
comes from <code>Upstream</code>, the response header
<code>X-APISIX-Upstream-Status</code> can be seen in the response header, and
the value of this response header is the response status code. When the
<code>5xx</code> status code is derived from <code>APISIX</cod [...]
+<h2><a class="anchor" aria-hidden="true" id="example"></a><a href="#example"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1- [...]
+<blockquote>
+<p>Example 1: <code>502</code> response status code comes from
<code>Upstream</code> (IP address is not available)</p>
+</blockquote>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "methods": ["GET"],
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1": 1
+ },
+ "type": "roundrobin"
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>Test:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 14:40:22 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+
+</code></pre>
+<p>It has a response header of <code>X-APISIX-Upstream-Status: 502</code>.</p>
+<blockquote>
+<p>Example 2: <code>502</code> response status code comes from
<code>APISIX</code></p>
+</blockquote>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "plugins": {
+ "fault-injection": {
+ "abort": {
+ "http_status": 500,
+ "body": "Fault Injection!\n"
+ }
+ }
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>Test:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 500 Internal Server Error
+< Date: Wed, 25 Nov 2020 14:50:20 GMT
+< Content-Type: text/plain; charset=utf-8
+< Transfer-Encoding: chunked
+< Connection: keep-alive
+< Server: APISIX/2.0
+<
+Fault Injection!
+</code></pre>
+<p>There is no response header for <code>X-APISIX-Upstream-Status</code>.</p>
+<blockquote>
+<p>Example 3: <code>Upstream</code> has multiple nodes, and all nodes are
unavailable</p>
+</blockquote>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/upstreams/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "nodes": {
+ "127.0.0.3:1": 1,
+ "127.0.0.2:1": 1,
+ "127.0.0.1:1": 1
+ },
+ "retries": 2,
+ "type": "roundrobin"
+}'
+</code></pre>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "uri": "/hello",
+ "upstream_id": "1"
+}'
+</code></pre>
+<p>Test:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 15:07:34 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502, 502, 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+</code></pre>
+<p>It has a response header of <code>X-APISIX-Upstream-Status: 502, 502,
502</code>.</p>
+</span></div></article></div><div class="docs-prevnext"></div></div></div><nav
class="onPageNav"><ul class="toc-headings"><li><a
href="#5xx-response-status-code"><code>5xx</code> response status
code</a></li><li><a
href="#how-to-identify-the-source-of-the-5xx-response-status-code">How to
identify the source of the <code>5xx</code> response status code</a></li><li><a
href="#example">Example</a></li></ul></nav></div><footer class="nav-footer"
id="footer"><section class="sitemap"><a href="/ [...]
+ document.addEventListener('keyup', function(e) {
+ if (e.target !== document.body) {
+ return;
+ }
+ // keyCode for '/' (slash)
+ if (e.keyCode === 191) {
+ const search =
document.getElementById('search_input_react');
+ search && search.focus();
+ }
+ });
+ </script><script>
+ var search = docsearch({
+ appId: 'ZHVP417Y1Y',
+ apiKey: '79e72fedcf3719ba85c552f710ade8a3',
+ indexName: 'apache-apisix-website',
+ inputSelector: '#search_input_react'
+ });
+ </script></body></html>
\ No newline at end of file
diff --git a/apisix/zh-cn/README.html b/apisix/zh-cn/README.html
index c96cea4..2c53caf 100644
--- a/apisix/zh-cn/README.html
+++ b/apisix/zh-cn/README.html
@@ -40,6 +40,7 @@
<li><a href="../../CHANGELOG_CN.md">变更日志</a></li>
<li><a href="/apisix/zh-cn/benchmark">压力测试</a></li>
<li><a href="../../CODE_STYLE_CN.md">代码风格</a></li>
+<li><a href="/apisix/zh-cn/debug-function">调试功能</a></li>
<li><a href="../../FAQ_CN.md">常见问答</a></li>
</ul>
<h2><a class="anchor" aria-hidden="true" id="插件"></a><a href="#插件"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c [...]
diff --git a/apisix/zh-cn/README/index.html b/apisix/zh-cn/README/index.html
index c96cea4..2c53caf 100644
--- a/apisix/zh-cn/README/index.html
+++ b/apisix/zh-cn/README/index.html
@@ -40,6 +40,7 @@
<li><a href="../../CHANGELOG_CN.md">变更日志</a></li>
<li><a href="/apisix/zh-cn/benchmark">压力测试</a></li>
<li><a href="../../CODE_STYLE_CN.md">代码风格</a></li>
+<li><a href="/apisix/zh-cn/debug-function">调试功能</a></li>
<li><a href="../../FAQ_CN.md">常见问答</a></li>
</ul>
<h2><a class="anchor" aria-hidden="true" id="插件"></a><a href="#插件"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c [...]
diff --git a/apisix/zh-cn/debug-function.html b/apisix/zh-cn/debug-function.html
new file mode 100644
index 0000000..fb81be6
--- /dev/null
+++ b/apisix/zh-cn/debug-function.html
@@ -0,0 +1,147 @@
+<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta
http-equiv="X-UA-Compatible"
content="IE=edge"/><title>apisix/zh-cn/debug-function · Apache
APISIX™</title><meta name="viewport" content="width=device-width"/><meta
name="generator" content="Docusaurus"/><meta name="description"
content="<!--"/><meta name="docsearch:language" content="en"/><meta
property="og:title" content="apisix/zh-cn/debug-function · Apache
APISIX™"/><meta property="og:type" content="website"/><meta [...]
+ document.addEventListener('DOMContentLoaded', function() {
+ addBackToTop(
+ {"zIndex":100}
+ )
+ });
+ </script><script src="/js/scrollSpy.js"></script><link
rel="stylesheet" href="/css/main.css"/><script
src="/js/codetabs.js"></script></head><body class="sideNavVisible
separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper
wrapper"><header><a href="/"><img class="logo" src="/img/logo.png" alt="Apache
APISIX™"/><h2 class="headerTitleWithLogo">Apache APISIX™</h2></a><div
class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul
class="nav-site n [...]
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+<p><a href="/apisix/debug-function">English</a></p>
+<h2><a class="anchor" aria-hidden="true" id="5xx-响应状态码"></a><a
href="#5xx-响应状态码" aria-hidden="true" class="hash-link"><svg
class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0
0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2
3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4
9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5
0-.83.42-1.6 [...]
+<p>500、502、503等类似的 <code>5xx</code> 状态码,是由于服务器错误而响应的状态码,当一个请求出现
<code>5xx</code> 状态码时;它可能来源于 <code>APISIX</code> 或 <code>Upstream</code>
。如何识别这些响应状态码的来源,是一件很有意义的事,它能够快速的帮助我们确定问题的所在。</p>
+<h2><a class="anchor" aria-hidden="true" id="如何识别-5xx-响应状态码的来源"></a><a
href="#如何识别-5xx-响应状态码的来源" aria-hidden="true" class="hash-link"><svg
class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0
0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2
3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4
9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2- [...]
+<p>在请求的响应头中,通过 <code>X-APISIX-Upstream-Status</code> 这个响应头,我们可以有效的识别
<code>5xx</code> 状态码的来源。当 <code>5xx</code> 状态码来源于 <code>Upstream</code>
时,在响应头中可以看到 <code>X-APISIX-Upstream-Status</code> 这个响应头,并且这个响应头的值为响应的状态码。当
<code>5xx</code> 状态码来源于 <code>APISIX</code> 时,响应头中没有
<code>X-APISIX-Upstream-Status</code> 的响应头信息。也就是只有 <code>5xx</code> 状态码来源于
<code>Upstream</code> 时,才会有 <code>X-APISIX-Upstream-Status</code> 响应头。</p>
+<h2><a class="anchor" aria-hidden="true" id="示例"></a><a href="#示例"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c [...]
+<p>示例1:<code>502</code> 响应状态码来源于 <code>Upstream</code> (IP地址不可用)</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "methods": ["GET"],
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1": 1
+ },
+ "type": "roundrobin"
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>测试:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 14:40:22 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+
+</code></pre>
+<p>具有 <code>X-APISIX-Upstream-Status: 502</code> 的响应头。</p>
+<p>示例2: <code>502</code> 响应状态码来源于 <code>APISIX</code></p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "plugins": {
+ "fault-injection": {
+ "abort": {
+ "http_status": 500,
+ "body": "Fault Injection!\n"
+ }
+ }
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>测试:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 500 Internal Server Error
+< Date: Wed, 25 Nov 2020 14:50:20 GMT
+< Content-Type: text/plain; charset=utf-8
+< Transfer-Encoding: chunked
+< Connection: keep-alive
+< Server: APISIX/2.0
+<
+Fault Injection!
+</code></pre>
+<p>没有 <code>X-APISIX-Upstream-Status</code> 的响应头。</p>
+<p>示例3:<code>Upstream</code> 具有多节点,并且所有节点不可用</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/upstreams/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "nodes": {
+ "127.0.0.3:1": 1,
+ "127.0.0.2:1": 1,
+ "127.0.0.1:1": 1
+ },
+ "retries": 2,
+ "type": "roundrobin"
+}'
+</code></pre>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "uri": "/hello",
+ "upstream_id": "1"
+}'
+</code></pre>
+<p>测试:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 15:07:34 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502, 502, 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+</code></pre>
+<p>具有 <code>X-APISIX-Upstream-Status: 502, 502, 502</code> 的响应头。</p>
+</span></div></article></div><div class="docs-prevnext"></div></div></div><nav
class="onPageNav"><ul class="toc-headings"><li><a
href="#5xx-响应状态码"><code>5xx</code> 响应状态码</a></li><li><a
href="#如何识别-5xx-响应状态码的来源">如何识别 <code>5xx</code> 响应状态码的来源</a></li><li><a
href="#示例">示例</a></li></ul></nav></div><footer class="nav-footer"
id="footer"><section class="sitemap"><a href="/"
class="nav-home"></a><div><h5>ASF</h5><a
href="https://www.apache.org/">Foundation</a><a href="https://www.apache.org/li
[...]
+ document.addEventListener('keyup', function(e) {
+ if (e.target !== document.body) {
+ return;
+ }
+ // keyCode for '/' (slash)
+ if (e.keyCode === 191) {
+ const search =
document.getElementById('search_input_react');
+ search && search.focus();
+ }
+ });
+ </script><script>
+ var search = docsearch({
+ appId: 'ZHVP417Y1Y',
+ apiKey: '79e72fedcf3719ba85c552f710ade8a3',
+ indexName: 'apache-apisix-website',
+ inputSelector: '#search_input_react'
+ });
+ </script></body></html>
\ No newline at end of file
diff --git a/apisix/zh-cn/debug-function/index.html
b/apisix/zh-cn/debug-function/index.html
new file mode 100644
index 0000000..fb81be6
--- /dev/null
+++ b/apisix/zh-cn/debug-function/index.html
@@ -0,0 +1,147 @@
+<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta
http-equiv="X-UA-Compatible"
content="IE=edge"/><title>apisix/zh-cn/debug-function · Apache
APISIX™</title><meta name="viewport" content="width=device-width"/><meta
name="generator" content="Docusaurus"/><meta name="description"
content="<!--"/><meta name="docsearch:language" content="en"/><meta
property="og:title" content="apisix/zh-cn/debug-function · Apache
APISIX™"/><meta property="og:type" content="website"/><meta [...]
+ document.addEventListener('DOMContentLoaded', function() {
+ addBackToTop(
+ {"zIndex":100}
+ )
+ });
+ </script><script src="/js/scrollSpy.js"></script><link
rel="stylesheet" href="/css/main.css"/><script
src="/js/codetabs.js"></script></head><body class="sideNavVisible
separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper
wrapper"><header><a href="/"><img class="logo" src="/img/logo.png" alt="Apache
APISIX™"/><h2 class="headerTitleWithLogo">Apache APISIX™</h2></a><div
class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul
class="nav-site n [...]
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+<p><a href="/apisix/debug-function">English</a></p>
+<h2><a class="anchor" aria-hidden="true" id="5xx-响应状态码"></a><a
href="#5xx-响应状态码" aria-hidden="true" class="hash-link"><svg
class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0
0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2
3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4
9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5
0-.83.42-1.6 [...]
+<p>500、502、503等类似的 <code>5xx</code> 状态码,是由于服务器错误而响应的状态码,当一个请求出现
<code>5xx</code> 状态码时;它可能来源于 <code>APISIX</code> 或 <code>Upstream</code>
。如何识别这些响应状态码的来源,是一件很有意义的事,它能够快速的帮助我们确定问题的所在。</p>
+<h2><a class="anchor" aria-hidden="true" id="如何识别-5xx-响应状态码的来源"></a><a
href="#如何识别-5xx-响应状态码的来源" aria-hidden="true" class="hash-link"><svg
class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0
0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5
0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2
3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4
9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2- [...]
+<p>在请求的响应头中,通过 <code>X-APISIX-Upstream-Status</code> 这个响应头,我们可以有效的识别
<code>5xx</code> 状态码的来源。当 <code>5xx</code> 状态码来源于 <code>Upstream</code>
时,在响应头中可以看到 <code>X-APISIX-Upstream-Status</code> 这个响应头,并且这个响应头的值为响应的状态码。当
<code>5xx</code> 状态码来源于 <code>APISIX</code> 时,响应头中没有
<code>X-APISIX-Upstream-Status</code> 的响应头信息。也就是只有 <code>5xx</code> 状态码来源于
<code>Upstream</code> 时,才会有 <code>X-APISIX-Upstream-Status</code> 响应头。</p>
+<h2><a class="anchor" aria-hidden="true" id="示例"></a><a href="#示例"
aria-hidden="true" class="hash-link"><svg class="hash-link-icon"
aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16"
width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10
5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2
2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c [...]
+<p>示例1:<code>502</code> 响应状态码来源于 <code>Upstream</code> (IP地址不可用)</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "methods": ["GET"],
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1": 1
+ },
+ "type": "roundrobin"
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>测试:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 14:40:22 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+
+</code></pre>
+<p>具有 <code>X-APISIX-Upstream-Status: 502</code> 的响应头。</p>
+<p>示例2: <code>502</code> 响应状态码来源于 <code>APISIX</code></p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "plugins": {
+ "fault-injection": {
+ "abort": {
+ "http_status": 500,
+ "body": "Fault Injection!\n"
+ }
+ }
+ },
+ "uri": "/hello"
+}'
+</code></pre>
+<p>测试:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+......
+< HTTP/1.1 500 Internal Server Error
+< Date: Wed, 25 Nov 2020 14:50:20 GMT
+< Content-Type: text/plain; charset=utf-8
+< Transfer-Encoding: chunked
+< Connection: keep-alive
+< Server: APISIX/2.0
+<
+Fault Injection!
+</code></pre>
+<p>没有 <code>X-APISIX-Upstream-Status</code> 的响应头。</p>
+<p>示例3:<code>Upstream</code> 具有多节点,并且所有节点不可用</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/upstreams/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "nodes": {
+ "127.0.0.3:1": 1,
+ "127.0.0.2:1": 1,
+ "127.0.0.1:1": 1
+ },
+ "retries": 2,
+ "type": "roundrobin"
+}'
+</code></pre>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl
http://127.0.0.1:9080/apisix/admin/routes/1 -H <span
class="hljs-string">'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'</span> -X PUT
-d <span class="hljs-string">'</span></span>
+{
+ "uri": "/hello",
+ "upstream_id": "1"
+}'
+</code></pre>
+<p>测试:</p>
+<pre><code class="hljs css language-shell"><span
class="hljs-meta">$</span><span class="bash"> curl http://127.0.0.1:9080/hello
-v</span>
+< HTTP/1.1 502 Bad Gateway
+< Date: Wed, 25 Nov 2020 15:07:34 GMT
+< Content-Type: text/html; charset=utf-8
+< Content-Length: 154
+< Connection: keep-alive
+< Server: APISIX/2.0
+< X-APISIX-Upstream-Status: 502, 502, 502
+<
+<html>
+<head><title>502 Bad Gateway</title></head>
+<body>
+<center><h1>502 Bad Gateway</h1></center>
+<hr><center>openresty</center>
+</body>
+</html>
+</code></pre>
+<p>具有 <code>X-APISIX-Upstream-Status: 502, 502, 502</code> 的响应头。</p>
+</span></div></article></div><div class="docs-prevnext"></div></div></div><nav
class="onPageNav"><ul class="toc-headings"><li><a
href="#5xx-响应状态码"><code>5xx</code> 响应状态码</a></li><li><a
href="#如何识别-5xx-响应状态码的来源">如何识别 <code>5xx</code> 响应状态码的来源</a></li><li><a
href="#示例">示例</a></li></ul></nav></div><footer class="nav-footer"
id="footer"><section class="sitemap"><a href="/"
class="nav-home"></a><div><h5>ASF</h5><a
href="https://www.apache.org/">Foundation</a><a href="https://www.apache.org/li
[...]
+ document.addEventListener('keyup', function(e) {
+ if (e.target !== document.body) {
+ return;
+ }
+ // keyCode for '/' (slash)
+ if (e.keyCode === 191) {
+ const search =
document.getElementById('search_input_react');
+ search && search.focus();
+ }
+ });
+ </script><script>
+ var search = docsearch({
+ appId: 'ZHVP417Y1Y',
+ apiKey: '79e72fedcf3719ba85c552f710ade8a3',
+ indexName: 'apache-apisix-website',
+ inputSelector: '#search_input_react'
+ });
+ </script></body></html>
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
index 67c6495..e3a9ef0 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="UTF-8"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://apisix.apache.org/help</loc><changefreq>weekly</changefreq><priority>0.5</priority><x
[...]
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><url><loc>https://apisix.apache.org/help</loc><changefreq>weekly</changefreq><priority>0.5</priority><x
[...]
\ No newline at end of file