<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## 5\. Routes *地址*:/routes *說明*:Route 字面意思就是路由,通過定義一些規則來匹配客戶端的請求,然后根據匹配結果加載并執行相應的 插件,并把請求轉發給到指定 Upstream。 ### 5.1 請求方法 | 序號 | NAME | 請求URI | 請求body | 說明 | | --- | --- | --- | --- | --- | | 1 | POST | /routes | {...} | 新增routes | | 2 | POST | /services/{service name or id}/routes | {...} | 在當前服務下創建路由 | | 3 | GET | /routes | | 獲取路由列表 | | 4 | GET | /services/{service name or id}/routes | 服務名稱或ID | 獲取服務下的路由列表 | | 5 | GET | /routes/{name or id} | 路由名稱或ID | 獲取單 個路由信息 | | 6 | GET | /plugins/{plugin id}/route | 插件ID | 同上 | | 7 | PATCH | /routes/{name or id} | 路由名稱或ID<br>{...} | 更新路由 | | 8 | PATCH | /plugins/{plugin id}/route | 插件ID<br>{...} | 同上 | | 9 | PUT | /routes/{name or id} | {...} | 新增/更新路由 | | 10 | PUT | /plugins/{plugin id}/route | {...} | 新增/更新路由 | | 11 | DELETE | /routes/{name or id} | 路由名稱或ID | 刪除路由 | ### 5.2 body 請求參數 | 序號 | 參數名 | 可選 | 默認值 | 說明 | 示例 | | --- | --- | --- | --- | --- | --- | | 1 | name | 可選 | | 標識路由名稱 | examples.v1.route | | 2 | protocols | 必選 | `["http", "https"]` | 路由訪問協議 | | | 3 | methods | 半選 | | methods、hosts、paths三者至少填寫一個 | GET or POST | | 4 | hosts | 半選 | | 同上 | \["[example.com](http://example.com)","foo.test"\] | | 6 | paths | 半選 | | 同上 | \["/path1","/path2"\] | | 7 | https\_redirect\_status\_code | 可選 | 426 | 重定向的狀態碼 | 426 | | 8 | regex\_priority | | 0 | 正則匹配優先級 | | | 9 | strip\_path | | true | 是否過濾掉【截取】請求中的path | | | 10 | preserve\_host | | false | 是否保留請求的host到請求頭中對上游服務進行請求,設置為false,則使用service中的host放在請求頭中對請求上游執行服務請求 | | | 11 | snis | | | 當使用協議為tcp或tls時,snis、sources、destinations三者至少填寫一項 | | | 12 | sources | | | 同上 | | | 13 | destinations | | | 同上 | | | 14 | tags | | | 標簽 | | | 15 | service | | | 所屬服務 | service.id=<[service.id](http://service.id)\>或"service":{"id":""} | | 16 | path\_handling | 可選 | v1 | 可選值:v0,v1<br>(注:v1.5.0版本+) | v1 | ### 5.3 數據樣例 body 請求 ``` { "id": "51e77dc2-8f3e-4afa-9d0e-0e3bbbcfd515", "created_at": 1422386534, "updated_at": 1422386534, "name": "my-route", "protocols": ["http", "https"], "methods": ["GET", "POST"], "hosts": ["example.com", "foo.test"], "paths": ["/foo", "/bar"], "https_redirect_status_code": 426, "regex_priority": 0, "strip_path": true, "preserve_host": false, "tags": ["user-level", "low-priority"], "service": {"id":"fc73f2af-890d-4f9b-8363-af8945001f7f"} } ``` 路由列表 ``` { "data": [{ "id": "4506673d-c825-444c-a25b-602e3c2ec16e", "created_at": 1422386534, "updated_at": 1422386534, "name": "my-route", "protocols": ["http", "https"], "methods": ["GET", "POST"], "hosts": ["example.com", "foo.test"], "paths": ["/foo", "/bar"], "https_redirect_status_code": 426, "regex_priority": 0, "strip_path": true, "preserve_host": false, "tags": ["user-level", "low-priority"], "service": {"id":"d35165e2-d03e-461a-bdeb-dad0a112abfe"} }, { "id": "af8330d3-dbdc-48bd-b1be-55b98608834b", "created_at": 1422386534, "updated_at": 1422386534, "name": "my-route", "protocols": ["tcp", "tls"], "https_redirect_status_code": 426, "regex_priority": 0, "strip_path": true, "preserve_host": false, "snis": ["foo.test", "example.com"], "sources": [{"ip":"10.1.0.0/16", "port":1234}, {"ip":"10.2.2.2"}, {"port":9123}], "destinations": [{"ip":"10.1.0.0/16", "port":1234}, {"ip":"10.2.2.2"}, {"port":9123}], "tags": ["admin", "high-priority", "critical"], "service": {"id":"a9daa3ba-8186-4a0d-96e8-00d80ce7240b"} }], "next": "http://localhost:8001/routes?offset=6378122c-a0a1-438d-a5c6-efabae9fb969" } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看