mirror of
https://gitee.com/iresty/apisix.git
synced 2024-11-30 02:57:49 +08:00
docs: added sidebar
config (#3699)
Co-authored-by: juzhiyuan <juzhiyuan@apache.org>
This commit is contained in:
parent
f3449f30f8
commit
c87e3798ee
98
README.md
98
README.md
@ -65,75 +65,75 @@ A/B testing, canary release, blue-green deployment, limit rate, defense against
|
||||
|
||||
- **Multi protocols**
|
||||
|
||||
- [TCP/UDP Proxy](docs/en/latest/stream-proxy.md): Dynamic TCP/UDP proxy.
|
||||
- [Dubbo Proxy](docs/en/latest/plugins/dubbo-proxy.md): Dynamic HTTP to Dubbo proxy.
|
||||
- [Dynamic MQTT Proxy](docs/en/latest/plugins/mqtt-proxy.md): Supports to load balance MQTT by `client_id`, both support MQTT [3.1.\*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html), [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
|
||||
- [gRPC proxy](docs/en/latest/grpc-proxy.md): Proxying gRPC traffic.
|
||||
- [gRPC transcoding](docs/en/latest/plugins/grpc-transcode.md): Supports protocol transcoding so that clients can access your gRPC API by using HTTP/JSON.
|
||||
- [TCP/UDP Proxy](stream-proxy.md): Dynamic TCP/UDP proxy.
|
||||
- [Dubbo Proxy](plugins/dubbo-proxy.md): Dynamic HTTP to Dubbo proxy.
|
||||
- [Dynamic MQTT Proxy](plugins/mqtt-proxy.md): Supports to load balance MQTT by `client_id`, both support MQTT [3.1.\*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html), [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
|
||||
- [gRPC proxy](grpc-proxy.md): Proxying gRPC traffic.
|
||||
- [gRPC transcoding](plugins/grpc-transcode.md): Supports protocol transcoding so that clients can access your gRPC API by using HTTP/JSON.
|
||||
- Proxy Websocket
|
||||
- Proxy Protocol
|
||||
- Proxy Dubbo: Dubbo Proxy based on Tengine.
|
||||
- HTTP(S) Forward Proxy
|
||||
- [SSL](docs/en/latest/https.md): Dynamically load an SSL certificate.
|
||||
- [SSL](https.md): Dynamically load an SSL certificate.
|
||||
|
||||
- **Full dynamic**
|
||||
|
||||
- [Hot Updates And Hot Plugins](docs/en/latest/plugins.md): Continuously updates its configurations and plugins without restarts!
|
||||
- [Proxy Rewrite](docs/en/latest/plugins/proxy-rewrite.md): Support rewrite the `host`, `uri`, `schema`, `enable_websocket`, `headers` of the request before send to upstream.
|
||||
- [Response Rewrite](docs/en/latest/plugins/response-rewrite.md): Set customized response status code, body and header to the client.
|
||||
- [Serverless](docs/en/latest/plugins/serverless.md): Invoke functions in each phase in APISIX.
|
||||
- [Hot Updates And Hot Plugins](plugins.md): Continuously updates its configurations and plugins without restarts!
|
||||
- [Proxy Rewrite](plugins/proxy-rewrite.md): Support rewrite the `host`, `uri`, `schema`, `enable_websocket`, `headers` of the request before send to upstream.
|
||||
- [Response Rewrite](plugins/response-rewrite.md): Set customized response status code, body and header to the client.
|
||||
- [Serverless](plugins/serverless.md): Invoke functions in each phase in APISIX.
|
||||
- Dynamic Load Balancing: Round-robin load balancing with weight.
|
||||
- Hash-based Load Balancing: Load balance with consistent hashing sessions.
|
||||
- [Health Checks](docs/en/latest/health-check.md): Enable health check on the upstream node, and will automatically filter unhealthy nodes during load balancing to ensure system stability.
|
||||
- [Health Checks](health-check.md): Enable health check on the upstream node, and will automatically filter unhealthy nodes during load balancing to ensure system stability.
|
||||
- Circuit-Breaker: Intelligent tracking of unhealthy upstream services.
|
||||
- [Proxy Mirror](docs/en/latest/plugins/proxy-mirror.md): Provides the ability to mirror client requests.
|
||||
- [Traffic Split](docs/en/latest/plugins/traffic-split.md): Allows users to incrementally direct percentages of traffic between various upstreams.
|
||||
- [Proxy Mirror](plugins/proxy-mirror.md): Provides the ability to mirror client requests.
|
||||
- [Traffic Split](plugins/traffic-split.md): Allows users to incrementally direct percentages of traffic between various upstreams.
|
||||
|
||||
- **Fine-grained routing**
|
||||
|
||||
- [Supports full path matching and prefix matching](docs/en/latest/router-radixtree.md#how-to-use-libradixtree-in-apisix)
|
||||
- [Support all Nginx built-in variables as conditions for routing](/docs/en/latest/router-radixtree.md#how-to-filter-route-by-nginx-builtin-variable), so you can use `cookie`, `args`, etc. as routing conditions to implement canary release, A/B testing, etc.
|
||||
- [Supports full path matching and prefix matching](router-radixtree.md#how-to-use-libradixtree-in-apisix)
|
||||
- [Support all Nginx built-in variables as conditions for routing](/router-radixtree.md#how-to-filter-route-by-nginx-builtin-variable), so you can use `cookie`, `args`, etc. as routing conditions to implement canary release, A/B testing, etc.
|
||||
- Support [various operators as judgment conditions for routing](https://github.com/iresty/lua-resty-radixtree#operator-list), for example `{"arg_age", ">", 24}`
|
||||
- Support [custom route matching function](https://github.com/iresty/lua-resty-radixtree/blob/master/t/filter-fun.t#L10)
|
||||
- IPv6: Use IPv6 to match route.
|
||||
- Support [TTL](docs/en/latest/admin-api.md#route)
|
||||
- [Support priority](docs/en/latest/router-radixtree.md#3-match-priority)
|
||||
- [Support Batch Http Requests](docs/en/latest/plugins/batch-requests.md)
|
||||
- Support [TTL](admin-api.md#route)
|
||||
- [Support priority](router-radixtree.md#3-match-priority)
|
||||
- [Support Batch Http Requests](plugins/batch-requests.md)
|
||||
|
||||
- **Security**
|
||||
|
||||
- Authentications: [key-auth](docs/en/latest/plugins/key-auth.md), [JWT](docs/en/latest/plugins/jwt-auth.md), [basic-auth](docs/en/latest/plugins/basic-auth.md), [wolf-rbac](docs/en/latest/plugins/wolf-rbac.md)
|
||||
- [IP Whitelist/Blacklist](docs/en/latest/plugins/ip-restriction.md)
|
||||
- [Referer Whitelist/Blacklist](docs/en/latest/plugins/referer-restriction.md)
|
||||
- [IdP](docs/en/latest/plugins/openid-connect.md): Support external authentication services, such as Auth0, okta, etc., users can use this to connect to OAuth 2.0 and other authentication methods.
|
||||
- [Limit-req](docs/en/latest/plugins/limit-req.md)
|
||||
- [Limit-count](docs/en/latest/plugins/limit-count.md)
|
||||
- [Limit-concurrency](docs/en/latest/plugins/limit-conn.md)
|
||||
- Authentications: [key-auth](plugins/key-auth.md), [JWT](plugins/jwt-auth.md), [basic-auth](plugins/basic-auth.md), [wolf-rbac](plugins/wolf-rbac.md)
|
||||
- [IP Whitelist/Blacklist](plugins/ip-restriction.md)
|
||||
- [Referer Whitelist/Blacklist](plugins/referer-restriction.md)
|
||||
- [IdP](plugins/openid-connect.md): Support external authentication services, such as Auth0, okta, etc., users can use this to connect to OAuth 2.0 and other authentication methods.
|
||||
- [Limit-req](plugins/limit-req.md)
|
||||
- [Limit-count](plugins/limit-count.md)
|
||||
- [Limit-concurrency](plugins/limit-conn.md)
|
||||
- Anti-ReDoS(Regular expression Denial of Service): Built-in policies to Anti ReDoS without configuration.
|
||||
- [CORS](docs/en/latest/plugins/cors.md) Enable CORS(Cross-origin resource sharing) for your API.
|
||||
- [URI Blocker](docs/en/latest/plugins/uri-blocker.md): Block client request by URI.
|
||||
- [Request Validator](docs/en/latest/plugins/request-validation.md)
|
||||
- [CORS](plugins/cors.md) Enable CORS(Cross-origin resource sharing) for your API.
|
||||
- [URI Blocker](plugins/uri-blocker.md): Block client request by URI.
|
||||
- [Request Validator](plugins/request-validation.md)
|
||||
|
||||
- **OPS friendly**
|
||||
|
||||
- OpenTracing: support [Apache Skywalking](docs/en/latest/plugins/skywalking.md) and [Zipkin](docs/en/latest/plugins/zipkin.md)
|
||||
- works with external service discovery:In addition to the built-in etcd, it also supports `Consul` and `Nacos` [DNS discovery mode](https://github.com/apache/apisix/issues/1731#issuecomment-646392129), and [Eureka](docs/en/latest/discovery.md)
|
||||
- Monitoring And Metrics: [Prometheus](docs/en/latest/plugins/prometheus.md)
|
||||
- OpenTracing: support [Apache Skywalking](plugins/skywalking.md) and [Zipkin](plugins/zipkin.md)
|
||||
- works with external service discovery:In addition to the built-in etcd, it also supports `Consul` and `Nacos` [DNS discovery mode](https://github.com/apache/apisix/issues/1731#issuecomment-646392129), and [Eureka](discovery.md)
|
||||
- Monitoring And Metrics: [Prometheus](plugins/prometheus.md)
|
||||
- Clustering: APISIX nodes are stateless, creates clustering of the configuration center, please refer to [etcd Clustering Guide](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/clustering.md).
|
||||
- High availability: support to configure multiple etcd addresses in the same cluster.
|
||||
- [Dashboard](https://github.com/apache/apisix-dashboard)
|
||||
- Version Control: Supports rollbacks of operations.
|
||||
- CLI: start\stop\reload APISIX through the command line.
|
||||
- [Stand-alone mode](docs/en/latest/stand-alone.md): Supports to load route rules from local yaml file, it is more friendly such as under the kubernetes(k8s).
|
||||
- [Global Rule](docs/en/latest/architecture-design.md#global-rule): Allows to run any plugin for all request, eg: limit rate, IP filter etc.
|
||||
- [Stand-alone mode](stand-alone.md): Supports to load route rules from local yaml file, it is more friendly such as under the kubernetes(k8s).
|
||||
- [Global Rule](architecture-design.md#global-rule): Allows to run any plugin for all request, eg: limit rate, IP filter etc.
|
||||
- High performance: The single-core QPS reaches 18k with an average delay of less than 0.2 milliseconds.
|
||||
- [Fault Injection](docs/en/latest/plugins/fault-injection.md)
|
||||
- [REST Admin API](docs/en/latest/admin-api.md): Using the REST Admin API to control Apache APISIX, which only allows 127.0.0.1 access by default, you can modify the `allow_admin` field in `conf/config.yaml` to specify a list of IPs that are allowed to call the Admin API. Also note that the Admin API uses key auth to verify the identity of the caller. **The `admin_key` field in `conf/config.yaml` needs to be modified before deployment to ensure security**.
|
||||
- External Loggers: Export access logs to external log management tools. ([HTTP Logger](docs/en/latest/plugins/http-logger.md), [TCP Logger](docs/en/latest/plugins/tcp-logger.md), [Kafka Logger](docs/en/latest/plugins/kafka-logger.md), [UDP Logger](docs/en/latest/plugins/udp-logger.md))
|
||||
- [Fault Injection](plugins/fault-injection.md)
|
||||
- [REST Admin API](admin-api.md): Using the REST Admin API to control Apache APISIX, which only allows 127.0.0.1 access by default, you can modify the `allow_admin` field in `conf/config.yaml` to specify a list of IPs that are allowed to call the Admin API. Also note that the Admin API uses key auth to verify the identity of the caller. **The `admin_key` field in `conf/config.yaml` needs to be modified before deployment to ensure security**.
|
||||
- External Loggers: Export access logs to external log management tools. ([HTTP Logger](plugins/http-logger.md), [TCP Logger](plugins/tcp-logger.md), [Kafka Logger](plugins/kafka-logger.md), [UDP Logger](plugins/udp-logger.md))
|
||||
- [Helm charts](https://github.com/apache/apisix-helm-chart)
|
||||
|
||||
- **Highly scalable**
|
||||
- [Custom plugins](docs/en/latest/plugin-develop.md): Allows hooking of common phases, such as `rewrite`, `access`, `header filter`, `body filter` and `log`, also allows to hook the `balancer` stage.
|
||||
- [Custom plugins](plugin-develop.md): Allows hooking of common phases, such as `rewrite`, `access`, `header filter`, `body filter` and `log`, also allows to hook the `balancer` stage.
|
||||
- Custom load balancing algorithms: You can use custom load balancing algorithms during the `balancer` phase.
|
||||
- Custom routing: Support users to implement routing algorithms themselves.
|
||||
|
||||
@ -148,7 +148,8 @@ CentOS 7, Ubuntu 16.04, Ubuntu 18.04, Debian 9, Debian 10, macOS, **ARM64** Ubun
|
||||
There are several ways to install the Apache Release version of APISIX:
|
||||
|
||||
1. Source code compilation (applicable to all systems)
|
||||
- Installation runtime dependencies: OpenResty and etcd, and compilation dependencies: luarocks. Refer to [install dependencies documentation](docs/en/latest/install-dependencies.md)
|
||||
|
||||
- Installation runtime dependencies: OpenResty and etcd, and compilation dependencies: luarocks. Refer to [install dependencies documentation](install-dependencies.md)
|
||||
- Download the latest source code release package:
|
||||
|
||||
```shell
|
||||
@ -186,7 +187,8 @@ There are several ways to install the Apache Release version of APISIX:
|
||||
The Docker image does not include `etcd`, you can refer to [docker compose example](https://github.com/apache/apisix-docker/tree/master/example) to start a test cluster.
|
||||
|
||||
3. RPM package(only for CentOS 7)
|
||||
- Installation runtime dependencies: OpenResty, etcd and OpenSSL develop library, refer to [install dependencies documentation](docs/en/latest/install-dependencies.md#centos-7)
|
||||
|
||||
- Installation runtime dependencies: OpenResty, etcd and OpenSSL develop library, refer to [install dependencies documentation](install-dependencies.md#centos-7)
|
||||
- install APISIX:
|
||||
|
||||
```shell
|
||||
@ -229,21 +231,21 @@ There are several ways to install the Apache Release version of APISIX:
|
||||
|
||||
2. Getting started
|
||||
|
||||
The getting started guide is a great way to learn the basics of APISIX, just follow the steps in [Getting Started](docs/en/latest/getting-started.md).
|
||||
The getting started guide is a great way to learn the basics of APISIX, just follow the steps in [Getting Started](getting-started.md).
|
||||
|
||||
Further, you can follow the documentation to try more [plugins](docs/en/latest/README.md#plugins).
|
||||
Further, you can follow the documentation to try more [plugins](README.md#plugins).
|
||||
|
||||
3. Admin API
|
||||
|
||||
Apache APISIX provides [REST Admin API](docs/en/latest/admin-api.md) to dynamic control the Apache APISIX cluster.
|
||||
Apache APISIX provides [REST Admin API](admin-api.md) to dynamic control the Apache APISIX cluster.
|
||||
|
||||
4. Plugin development
|
||||
|
||||
You can refer to [plugin development guide](docs/en/latest/plugin-develop.md), and [sample plugin `echo`](docs/en/latest/plugins/echo.md) documentation and code implementation.
|
||||
You can refer to [plugin development guide](plugin-develop.md), and [sample plugin `echo`](plugins/echo.md) documentation and code implementation.
|
||||
|
||||
Please note that Apache APISIX plugins' added, updated, deleted, etc. are hot loaded, without restarting the service.
|
||||
|
||||
For more documents, please refer to [Apache APISIX Document Index](docs/en/latest/README.md)
|
||||
For more documents, please refer to [Apache APISIX Document Index](README.md)
|
||||
|
||||
## Benchmark
|
||||
|
||||
@ -317,15 +319,15 @@ Benchmark comparison test [details data](https://gist.github.com/membphis/137db9
|
||||
|
||||
A wide variety of companies and organizations use APISIX for research, production and commercial product, including:
|
||||
|
||||
<img src="https://raw.githubusercontent.com/api7/website-of-API7/master/user-wall.jpg" width="900" height="500">
|
||||
<img src="https://raw.githubusercontent.com/api7/website-of-API7/master/user-wall.jpg" width="900" height="500" />
|
||||
|
||||
Users are encouraged to add themselves to the [Powered By](docs/en/latest/powered-by.md) page.
|
||||
Users are encouraged to add themselves to the [Powered By](powered-by.md) page.
|
||||
|
||||
## Landscape
|
||||
|
||||
<p align="left">
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200">
|
||||
<br><br>
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200" />
|
||||
<br /><br />
|
||||
APISIX enriches the <a href="https://landscape.cncf.io/card-mode?category=api-gateway&grouping=category">
|
||||
CNCF API Gateway Landscape.</a>
|
||||
</p>
|
||||
|
353
README_CN.md
353
README_CN.md
@ -1,353 +0,0 @@
|
||||
<!--
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
-->
|
||||
|
||||
# Apache APISIX
|
||||
|
||||
<img src="https://svn.apache.org/repos/asf/comdev/project-logos/originals/apisix.svg" alt="APISIX logo" height="150px" align="right" />
|
||||
|
||||
[![Build Status](https://github.com/apache/apisix/workflows/build/badge.svg?branch=master)](https://github.com/apache/apisix/actions)
|
||||
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/apache/apisix/blob/master/LICENSE)
|
||||
|
||||
**Apache APISIX** 是一个动态、实时、高性能的 API 网关,
|
||||
提供负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。
|
||||
|
||||
你可以使用 Apache APISIX 来处理传统的南北向流量,以及服务间的东西向流量,
|
||||
也可以当做 [k8s ingress controller](https://github.com/apache/apisix-ingress-controller) 来使用。
|
||||
|
||||
Apache APISIX 的技术架构如下图所示:
|
||||
|
||||
![](docs/assets/images/apisix.png)
|
||||
|
||||
## 社区
|
||||
|
||||
- 邮件列表 - 发送任意内容到 dev-subscribe@apisix.apache.org 后,根据回复以订阅邮件列表。
|
||||
- QQ 群 - 578997126
|
||||
- [Slack](http://s.apache.org/slack-invite) - 加入 `#apisix` 频道以便与成员交流。
|
||||
- ![Twitter Follow](https://img.shields.io/twitter/follow/ApacheAPISIX?style=social) - 使用标签 `#ApacheAPISIX` 关注我们并与我们互动。
|
||||
- [哔哩哔哩](https://space.bilibili.com/551921247)
|
||||
- **新手任务列表**
|
||||
- [Apache APISIX](https://github.com/apache/apisix/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX ingress controller](https://github.com/apache/apisix-ingress-controller/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX dashboard](https://github.com/apache/apisix-dashboard/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX Helm Chart](https://github.com/apache/apisix-helm-chart/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Docker distribution for APISIX](https://github.com/apache/apisix-docker/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX Website](https://github.com/apache/apisix-website/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [The Control-Plane for APISIX](https://github.com/apache/apisix-control-plane/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
|
||||
## 特性
|
||||
|
||||
你可以把 Apache APISIX 当做流量入口,来处理所有的业务数据,包括动态路由、动态上游、动态证书、
|
||||
A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵御恶意攻击、监控报警、服务可观测性、服务治理等。
|
||||
|
||||
- **全平台**
|
||||
|
||||
- 云原生: 平台无关,没有供应商锁定,无论裸机还是 Kubernetes,APISIX 都可以运行。
|
||||
- 运行环境: OpenResty 和 Tengine 都支持。
|
||||
- 支持 ARM64: 不用担心底层技术的锁定。
|
||||
|
||||
- **多协议**
|
||||
|
||||
- [TCP/UDP 代理](docs/zh/latest/stream-proxy.md): 动态 TCP/UDP 代理。
|
||||
- [Dubbo 代理](docs/zh/latest/plugins/dubbo-proxy.md): 动态代理 HTTP 请求到 Dubbo 后端。
|
||||
- [动态 MQTT 代理](docs/zh/latest/plugins/mqtt-proxy.md): 支持用 `client_id` 对 MQTT 进行负载均衡,同时支持 MQTT [3.1.\*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html) 和 [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html) 两个协议标准。
|
||||
- [gRPC 代理](docs/zh/latest/grpc-proxy.md):通过 APISIX 代理 gRPC 连接,并使用 APISIX 的大部分特性管理你的 gRPC 服务。
|
||||
- [gRPC 协议转换](docs/zh/latest/plugins/grpc-transcode.md):支持协议的转换,这样客户端可以通过 HTTP/JSON 来访问你的 gRPC API。
|
||||
- Websocket 代理
|
||||
- Proxy Protocol
|
||||
- Dubbo 代理:基于 Tengine,可以实现 Dubbo 请求的代理。
|
||||
- HTTP(S) 反向代理
|
||||
- [SSL](docs/zh/latest/https.md):动态加载 SSL 证书。
|
||||
|
||||
- **全动态能力**
|
||||
|
||||
- [热更新和热插件](docs/zh/latest/plugins.md): 无需重启服务,就可以持续更新配置和插件。
|
||||
- [代理请求重写](docs/zh/latest/plugins/proxy-rewrite.md): 支持重写请求上游的`host`、`uri`、`schema`、`enable_websocket`、`headers`信息。
|
||||
- [输出内容重写](docs/zh/latest/plugins/response-rewrite.md): 支持自定义修改返回内容的 `status code`、`body`、`headers`。
|
||||
- [Serverless](docs/zh/latest/plugins/serverless.md): 在 APISIX 的每一个阶段,你都可以添加并调用自己编写的函数。
|
||||
- 动态负载均衡:动态支持有权重的 round-robin 负载平衡。
|
||||
- 支持一致性 hash 的负载均衡:动态支持一致性 hash 的负载均衡。
|
||||
- [健康检查](docs/zh/latest/health-check.md):启用上游节点的健康检查,将在负载均衡期间自动过滤不健康的节点,以确保系统稳定性。
|
||||
- 熔断器: 智能跟踪不健康上游服务。
|
||||
- [代理镜像](docs/zh/latest/plugins/proxy-mirror.md): 提供镜像客户端请求的能力。
|
||||
- [流量拆分](docs/zh/latest/plugins/traffic-split.md): 允许用户逐步控制各个上游之间的流量百分比。
|
||||
|
||||
- **精细化路由**
|
||||
|
||||
- [支持全路径匹配和前缀匹配](docs/zh/latest/router-radixtree.md#how-to-use-libradixtree-in-apisix)
|
||||
- [支持使用 Nginx 所有内置变量做为路由的条件](/docs/zh/latest/router-radixtree.md#how-to-filter-route-by-nginx-builtin-variable),所以你可以使用 `cookie`, `args` 等做为路由的条件,来实现灰度发布、A/B 测试等功能
|
||||
- 支持[各类操作符做为路由的判断条件](https://github.com/iresty/lua-resty-radixtree#operator-list),比如 `{"arg_age", ">", 24}`
|
||||
- 支持[自定义路由匹配函数](https://github.com/iresty/lua-resty-radixtree/blob/master/t/filter-fun.t#L10)
|
||||
- IPv6:支持使用 IPv6 格式匹配路由
|
||||
- 支持路由的[自动过期(TTL)](docs/zh/latest/admin-api.md#route)
|
||||
- [支持路由的优先级](docs/zh/latest/router-radixtree.md#3-match-priority)
|
||||
- [支持批量 Http 请求](docs/zh/latest/plugins/batch-requests.md)
|
||||
|
||||
- **安全防护**
|
||||
|
||||
- 多种身份认证方式: [key-auth](docs/zh/latest/plugins/key-auth.md), [JWT](docs/zh/latest/plugins/jwt-auth.md), [basic-auth](docs/zh/latest/plugins/basic-auth.md), [wolf-rbac](docs/zh/latest/plugins/wolf-rbac.md)。
|
||||
- [IP 黑白名单](docs/zh/latest/plugins/ip-restriction.md)
|
||||
- [Referer 白名单](docs/zh/latest/plugins/referer-restriction.md)
|
||||
- [IdP 支持](docs/zh/latest/plugins/openid-connect.md): 支持外部的身份认证服务,比如 Auth0,Okta,Authing 等,用户可以借此来对接 Oauth2.0 等认证方式。
|
||||
- [限制速率](docs/zh/latest/plugins/limit-req.md)
|
||||
- [限制请求数](docs/zh/latest/plugins/limit-count.md)
|
||||
- [限制并发](docs/zh/latest/plugins/limit-conn.md)
|
||||
- 防御 ReDoS(正则表达式拒绝服务):内置策略,无需配置即可抵御 ReDoS。
|
||||
- [CORS](docs/zh/latest/plugins/cors.md):为你的 API 启用 CORS。
|
||||
- [URI 拦截器](docs/zh/latest/plugins/uri-blocker.md):根据 URI 拦截用户请求。
|
||||
- [请求验证器](docs/zh/latest/plugins/request-validation.md)。
|
||||
|
||||
- **运维友好**
|
||||
|
||||
- OpenTracing 可观测性: 支持 [Apache Skywalking](docs/zh/latest/plugins/skywalking.md) 和 [Zipkin](docs/zh/latest/plugins/zipkin.md)。
|
||||
- 对接外部服务发现:除了内置的 etcd 外,还支持 `Consul` 和 `Nacos` 的 [DNS 发现模式](https://github.com/apache/apisix/issues/1731#issuecomment-646392129),以及 [Eureka](docs/zh/latest/discovery.md)。
|
||||
- 监控和指标: [Prometheus](docs/zh/latest/plugins/prometheus.md)
|
||||
- 集群:APISIX 节点是无状态的,创建配置中心集群请参考 [etcd Clustering Guide](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/clustering.md)。
|
||||
- 高可用:支持配置同一个集群内的多个 etcd 地址。
|
||||
- [控制台](https://github.com/apache/apisix-dashboard): 操作 APISIX 集群。
|
||||
- 版本控制:支持操作的多次回滚。
|
||||
- CLI: 使用命令行来启动、关闭和重启 APISIX。
|
||||
- [单机模式](docs/zh/latest/stand-alone.md): 支持从本地配置文件中加载路由规则,在 kubernetes(k8s) 等环境下更友好。
|
||||
- [全局规则](docs/zh/latest/architecture-design.md#global-rule):允许对所有请求执行插件,比如黑白名单、限流限速等。
|
||||
- 高性能:在单核上 QPS 可以达到 18k,同时延迟只有 0.2 毫秒。
|
||||
- [故障注入](docs/zh/latest/plugins/fault-injection.md)
|
||||
- [REST Admin API](docs/zh/latest/admin-api.md): 使用 REST Admin API 来控制 Apache APISIX,默认只允许 127.0.0.1 访问,你可以修改 `conf/config.yaml` 中的 `allow_admin` 字段,指定允许调用 Admin API 的 IP 列表。同时需要注意的是,Admin API 使用 key auth 来校验调用者身份,**在部署前需要修改 `conf/config.yaml` 中的 `admin_key` 字段,来保证安全。**
|
||||
- 外部日志记录器:将访问日志导出到外部日志管理工具。([HTTP Logger](docs/zh/latest/plugins/http-logger.md), [TCP Logger](docs/zh/latest/plugins/tcp-logger.md), [Kafka Logger](docs/zh/latest/plugins/kafka-logger.md), [UDP Logger](docs/zh/latest/plugins/udp-logger.md))
|
||||
- [Helm charts](https://github.com/apache/apisix-helm-chart)
|
||||
|
||||
- **高度可扩展**
|
||||
- [自定义插件](docs/zh/latest/plugin-develop.md): 允许挂载常见阶段,例如`init`, `rewrite`,`access`,`balancer`,`header filter`,`body filter` 和 `log` 阶段。
|
||||
- 自定义负载均衡算法:可以在 `balancer` 阶段使用自定义负载均衡算法。
|
||||
- 自定义路由: 支持用户自己实现路由算法。
|
||||
|
||||
## 立刻开始
|
||||
|
||||
### 编译和安装
|
||||
|
||||
APISIX 在以下操作系统中可顺利安装并做过测试:
|
||||
|
||||
CentOS 7, Ubuntu 16.04, Ubuntu 18.04, Debian 9, Debian 10, macOS, **ARM64** Ubuntu 18.04
|
||||
|
||||
有以下几种方式来安装 APISIX 的 Apache Release 版本:
|
||||
|
||||
1. 源码编译(适用所有系统)
|
||||
- 安装运行时依赖:OpenResty 和 etcd,以及编译的依赖:luarocks。参考[依赖安装文档](docs/zh/latest/install-dependencies.md)
|
||||
- 下载最新的源码发布包:
|
||||
|
||||
```shell
|
||||
$ mkdir apisix-2.3
|
||||
$ wget https://downloads.apache.org/apisix/2.3/apache-apisix-2.3-src.tgz
|
||||
$ tar zxvf apache-apisix-2.3-src.tgz -C apisix-2.3
|
||||
```
|
||||
|
||||
- 安装运行时依赖的 Lua 库:
|
||||
|
||||
```shell
|
||||
$ make deps
|
||||
```
|
||||
|
||||
- 检查 APISIX 的版本号:
|
||||
|
||||
```shell
|
||||
$ ./bin/apisix version
|
||||
```
|
||||
|
||||
- 启动 APISIX:
|
||||
|
||||
```shell
|
||||
$ ./bin/apisix start
|
||||
```
|
||||
|
||||
2. [Docker 镜像](https://hub.docker.com/r/apache/apisix)(适用所有系统)
|
||||
|
||||
默认会拉取最新的 Apache 发布包:
|
||||
|
||||
```shell
|
||||
$ docker pull apache/apisix
|
||||
```
|
||||
|
||||
Docker 镜像中并不包含 etcd,你可以参考 [docker compose 的示例](https://github.com/apache/apisix-docker/tree/master/example)来启动一个测试集群。
|
||||
|
||||
3. RPM 包(只适用于 CentOS 7)
|
||||
- 安装依赖:OpenResty, etcd 和 OpenSSL develop library,参考[依赖安装文档](docs/zh/latest/install-dependencies.md#centos-7)
|
||||
- 安装 APISIX:
|
||||
|
||||
```shell
|
||||
$ sudo yum install -y https://github.com/apache/apisix/releases/download/2.3/apisix-2.3-0.x86_64.rpm
|
||||
```
|
||||
|
||||
- 检查 APISIX 的版本号:
|
||||
|
||||
```shell
|
||||
$ apisix version
|
||||
```
|
||||
|
||||
- 启动 APISIX:
|
||||
|
||||
```shell
|
||||
$ apisix start
|
||||
```
|
||||
|
||||
**注意**:Apache APISIX 从 v2.0 开始不再支持 etcd v2 协议,并且 etcd 最低支持版本为 v3.4.0,如果有需要请进行升级。如果需要将数据迁移至 etcd v3,请按照 [etcd 迁移指南](https://etcd.io/docs/v3.4.0/op-guide/v2-migration/) 进行迁移。
|
||||
|
||||
### 针对开发者
|
||||
|
||||
1. 对于开发者而言,可以使用最新的 master 分支来体验更多功能
|
||||
|
||||
- 源码编译
|
||||
|
||||
```shell
|
||||
$ git clone git@github.com:apache/apisix.git
|
||||
$ cd apisix
|
||||
$ make deps
|
||||
```
|
||||
|
||||
- Docker 镜像
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/apache/apisix-docker.git
|
||||
$ cd apisix-docker
|
||||
$ sudo docker build -f alpine-dev/Dockerfile .
|
||||
```
|
||||
|
||||
2. 入门指南
|
||||
|
||||
入门指南是学习 APISIX 基础知识的好方法。按照 [入门指南](docs/zh/latest/getting-started.md)的步骤即可。
|
||||
|
||||
更进一步,你可以跟着文档来尝试更多的[插件](docs/zh/latest/README.md#插件)。
|
||||
|
||||
3. Admin API
|
||||
|
||||
Apache APISIX 提供了 [REST Admin API](docs/zh/latest/admin-api.md),方便动态控制 Apache APISIX 集群。
|
||||
|
||||
4. 插件二次开发
|
||||
|
||||
可以参考[插件开发指南](docs/zh/latest/plugin-develop.md),以及[示例插件 echo](docs/zh/latest/plugins/echo.md) 的文档和代码实现。
|
||||
|
||||
请注意,Apache APISIX 的插件新增、更新、删除等都是热加载的,不用重启服务。
|
||||
|
||||
更多文档请参考 [Apache APISIX 文档索引](docs/zh/latest/README.md)。
|
||||
|
||||
## 性能测试
|
||||
|
||||
使用 AWS 的 8 核心服务器来压测 APISIX,QPS 可以达到 140000,同时延时只有 0.2 毫秒。
|
||||
|
||||
[性能测试脚本](benchmark/run.sh),以及[测试方法和过程](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)已经开源,欢迎补充。
|
||||
|
||||
## Apache APISIX 和 Kong 的比较
|
||||
|
||||
#### API 网关核心功能点,两者均已覆盖
|
||||
|
||||
| **功能** | **Apache APISIX** | **KONG** |
|
||||
| :------------------- | :---------------- | :------- |
|
||||
| **动态上游** | 支持 | 支持 |
|
||||
| **动态路由** | 支持 | 支持 |
|
||||
| **健康检查和熔断器** | 支持 | 支持 |
|
||||
| **动态 SSL 证书** | 支持 | 支持 |
|
||||
| **七层和四层代理** | 支持 | 支持 |
|
||||
| **分布式追踪** | 支持 | 支持 |
|
||||
| **自定义插件** | 支持 | 支持 |
|
||||
| **REST API** | 支持 | 支持 |
|
||||
| **CLI** | 支持 | 支持 |
|
||||
|
||||
#### Apache APISIX 的优势
|
||||
|
||||
| **功能** | **Apache APISIX** | **KONG** |
|
||||
| :------------------------------------ | :-------------------------------------- | :--------------------- |
|
||||
| 项目归属 | Apache 软件基金会 | Kong Inc. |
|
||||
| 技术架构 | Nginx + etcd | Nginx + postgres |
|
||||
| 交流渠道 | 微信群、QQ 群、邮件列表、GitHub、meetup | GitHub、论坛、freenode |
|
||||
| 单核 QPS (开启限流和 prometheus 插件) | 18000 | 1700 |
|
||||
| 平均延迟 | 0.2 毫秒 | 2 毫秒 |
|
||||
| 支持 Dubbo 代理 | 是 | 否 |
|
||||
| 配置回滚 | 是 | 否 |
|
||||
| 支持生命周期的路由 | 是 | 否 |
|
||||
| 插件热更新 | 是 | 否 |
|
||||
| 用户自定义:负载均衡算法、路由 | 是 | 否 |
|
||||
| resty <--> gRPC 转码 | 是 | 否 |
|
||||
| 支持 Tengine 作为运行时 | 是 | 否 |
|
||||
| MQTT 协议支持 | 是 | 否 |
|
||||
| 配置生效时间 | 事件通知,低于 1 毫秒更新 | 定期轮询,5 秒 |
|
||||
| 自带控制台 | 是 | 否 |
|
||||
| 对接外部身份认证服务 | 是 | 否 |
|
||||
| 配置中心高可用(HA) | 是 | 否 |
|
||||
| 指定时间窗口的限速 | 是 | 否 |
|
||||
| 支持任何 Nginx 变量做路由条件 | 是 | 否 |
|
||||
|
||||
性能对比测试[详细内容如下](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)。
|
||||
|
||||
### 贡献者变化
|
||||
|
||||
![contributor-over-time](docs/assets/images/contributor-over-time.png)
|
||||
|
||||
## 视频和文章
|
||||
|
||||
- 2020.10.16 [Apache APISIX: How to implement plugin orchestration in API Gateway](https://www.youtube.com/watch?v=iEegNXOtEhQ)
|
||||
- 2020.10.16 [Improve Apache APISIX observability with Apache Skywalking](https://www.youtube.com/watch?v=DleVJwPs4i4)
|
||||
- 2020.1.17 [API 网关 Apache APISIX 和 Kong 的选型对比](https://mp.weixin.qq.com/s/c51apneVj0O9yxiZAHF34Q)
|
||||
- 2019.12.14 [从 0 到 1:Apache APISIX 的 Apache 之路](https://zhuanlan.zhihu.com/p/99620158)
|
||||
- 2019.12.14 [基于 Apache APISIX 的下一代微服务架构](https://www.upyun.com/opentalk/445.html)
|
||||
- 2019.10.30 [Apache APISIX 微服务架构极致性能架构解析](https://www.upyun.com/opentalk/440.html)
|
||||
- 2019.9.27 [想把 APISIX 运行在 ARM64 平台上?只要三步](https://zhuanlan.zhihu.com/p/84467919)
|
||||
- 2019.8.31 [APISIX 技术选型、测试和持续集成](https://www.upyun.com/opentalk/433.html)
|
||||
- 2019.8.31 [APISIX 高性能实战 2](https://www.upyun.com/opentalk/437.html)
|
||||
- 2019.7.6 [APISIX 高性能实战](https://www.upyun.com/opentalk/429.html)
|
||||
|
||||
## 用户实际使用案例
|
||||
|
||||
- [欧盟数字工厂平台: API Security Gateway – Using APISIX in the eFactory Platform](https://www.efactory-project.eu/post/api-security-gateway-using-apisix-in-the-efactory-platform)
|
||||
- [贝壳找房:如何基于 Apache APISIX 搭建网关](https://mp.weixin.qq.com/s/yZl9MWPyF1-gOyCp8plflA)
|
||||
- [360:Apache APISIX 在基础运维平台项目中的实践](https://mp.weixin.qq.com/s/zHF_vlMaPOSoiNvqw60tVw)
|
||||
- [HelloTalk:基于 OpenResty 和 Apache APISIX 的全球化探索之路](https://www.upyun.com/opentalk/447.html)
|
||||
- [腾讯云:为什么选择 Apache APISIX 来实现 k8s ingress controller?](https://www.upyun.com/opentalk/448.html)
|
||||
- [思必驰:为什么我们重新写了一个 k8s ingress controller?](https://mp.weixin.qq.com/s/bmm2ibk2V7-XYneLo9XAPQ)
|
||||
|
||||
## APISIX 的用户有哪些?
|
||||
|
||||
有很多公司和组织把 APISIX 用于学习、研究、生产环境和商业产品中,包括:
|
||||
|
||||
<img src="https://raw.githubusercontent.com/api7/website-of-API7/master/user-wall.jpg" width="900" height="500">
|
||||
|
||||
欢迎用户把自己加入到 [Powered By](docs/zh/latest/powered-by.md) 页面。
|
||||
|
||||
## 全景图
|
||||
|
||||
<p align="left">
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200">
|
||||
<br><br>
|
||||
APISIX 被纳入 <a href="https://landscape.cncf.io/card-mode?category=api-gateway&grouping=category"> 云原生软件基金会 API 网关全景图</a>
|
||||
</p>
|
||||
|
||||
## Logo
|
||||
|
||||
- [Apache APISIX logo(PNG)](logos/apache-apisix.png)
|
||||
- [Apache APISIX logo 源文件](https://apache.org/logos/#apisix)
|
||||
|
||||
## 贡献
|
||||
|
||||
我们欢迎来自开源社区、个人和合作伙伴的各种贡献。
|
||||
|
||||
- [贡献指南](CONTRIBUTING.md)
|
||||
|
||||
## 致谢
|
||||
|
||||
灵感来自 Kong 和 Orange。
|
||||
|
||||
## 协议
|
||||
|
||||
[Apache 2.0 License](LICENSE)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: Changelog
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,7 +21,7 @@
|
||||
#
|
||||
-->
|
||||
|
||||
# Table of Contents
|
||||
## Table of Contents
|
||||
|
||||
- [2.3.0](#230)
|
||||
- [2.2.0](#220)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: APISIX Lua Coding Style Guide
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,10 +21,6 @@
|
||||
#
|
||||
-->
|
||||
|
||||
[Chinese](CODE_STYLE_CN.md)
|
||||
|
||||
# APISIX Lua Coding Style Guide
|
||||
|
||||
## indentation
|
||||
|
||||
Use 4 spaces as an indent:
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: FAQ
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,8 +21,6 @@
|
||||
#
|
||||
-->
|
||||
|
||||
# FAQ
|
||||
|
||||
## Why a new API gateway?
|
||||
|
||||
There are new requirements for API gateways in the field of microservices: higher flexibility, higher performance requirements, and cloud native.
|
||||
@ -33,7 +35,7 @@ In addition, APISIX has dynamic routing and hot loading of plug-ins, which is es
|
||||
|
||||
## What's the performance of APISIX?
|
||||
|
||||
One of the goals of APISIX design and development is the highest performance in the industry. Specific test data can be found here:[benchmark](https://github.com/apache/apisix/blob/master/docs/en/latest/benchmark.md)
|
||||
One of the goals of APISIX design and development is the highest performance in the industry. Specific test data can be found here:[benchmark](https://github.com/apache/apisix/blob/master/benchmark.md)
|
||||
|
||||
APISIX is the highest performance API gateway with a single-core QPS of 23,000, with an average delay of only 0.6 milliseconds.
|
||||
|
||||
@ -45,7 +47,7 @@ Yes, in version 0.6 we have dashboard built in, you can operate APISIX through t
|
||||
|
||||
Of course, APISIX provides flexible custom plugins for developers and businesses to write their own logic.
|
||||
|
||||
[How to write plugin](docs/en/latest/plugin-develop.md)
|
||||
[How to write plugin](plugin-develop.md)
|
||||
|
||||
## Why we choose etcd as the configuration center?
|
||||
|
||||
@ -115,7 +117,7 @@ https://github.com/iresty/lua-resty-radixtree#operator-list
|
||||
|
||||
2. Use `traffic-split` plugin to do it.
|
||||
|
||||
Please refer to the [traffic-split.md](docs/en/latest/plugins/traffic-split.md) plugin documentation for usage examples.
|
||||
Please refer to the [traffic-split.md](plugins/traffic-split.md) plugin documentation for usage examples.
|
||||
|
||||
## How to redirect http to https via APISIX?
|
||||
|
||||
@ -271,7 +273,7 @@ Now you can trace the info level log in logs/error.log.
|
||||
## How to reload your own plugin?
|
||||
|
||||
The Apache APISIX plugin supports hot reloading.
|
||||
See the `Hot reload` section in [plugins](./docs/en/latest/plugins.md) for how to do that.
|
||||
See the `Hot reload` section in [plugins](./plugins.md) for how to do that.
|
||||
|
||||
## How to make APISIX listen on multiple ports when handling HTTP or HTTPS requests?
|
||||
|
@ -1,108 +0,0 @@
|
||||
<!--
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
-->
|
||||
|
||||
## Reference Documentation
|
||||
|
||||
* [APISIX Readme](./README.md)
|
||||
* [Architecture Design](architecture-design.md)
|
||||
* [Getting Started Guide](getting-started.md)
|
||||
* [How to build Apache APISIX](how-to-build.md)
|
||||
* [Admin API](admin-api.md)
|
||||
* [Control API](control-api.md)
|
||||
* [Health Check](health-check.md): Enable health check on the upstream node, and will automatically filter unhealthy nodes during load balancing to ensure system stability.
|
||||
* [Router radixtree](router-radixtree.md)
|
||||
* [Stand Alone Model](stand-alone.md): Supports to load route rules from local yaml file, it is more friendly such as under the kubernetes(k8s).
|
||||
* [Stream Proxy](stream-proxy.md)
|
||||
* [gRPC Proxy](grpc-proxy.md)
|
||||
* [Customize Nginx Configuration](./customize-nginx-configuration.md)
|
||||
* [DNS](./dns.md)
|
||||
* [Changelog](../CHANGELOG.md)
|
||||
* [Benchmark](benchmark.md)
|
||||
* [Code Style](../CODE_STYLE.md)
|
||||
* [Debug Function](./debug-function.md)
|
||||
* [FAQ](../FAQ.md)
|
||||
|
||||
## Plugins
|
||||
|
||||
### General
|
||||
|
||||
* [batch-requests](plugins/batch-requests.md): Allow you send multiple http api via **http pipeline**.
|
||||
* [hot reload](plugins.md): Hot reload without reload service.
|
||||
* [HTTPS/TLS](https.md): Dynamic load the SSL Certificate by Server Name Indication (SNI).
|
||||
* [serverless](plugins/serverless.md):Allows to dynamically run Lua code at *different* phase in APISIX.
|
||||
* [redirect](plugins/redirect.md): URI redirect.
|
||||
|
||||
### Transformation
|
||||
|
||||
* [response-rewrite](plugins/response-rewrite.md): Set customized response status code, body and header to the client.
|
||||
* [proxy-rewrite](plugins/proxy-rewrite.md): Rewrite upstream request information.
|
||||
* [grpc-transcode](plugins/grpc-transcode.md): REST <--> gRPC transcoding.
|
||||
* [fault-injection](plugins/fault-injection.md): The specified response body, response code, and response time can be returned, which provides processing capabilities in different failure scenarios, such as service failure, service overload, and high service delay.
|
||||
|
||||
### Authentication
|
||||
|
||||
* [key-auth](plugins/key-auth.md): User authentication based on Key Authentication.
|
||||
* [JWT-auth](plugins/jwt-auth.md): User authentication based on [JWT](https://jwt.io/) (JSON Web Tokens) Authentication.
|
||||
* [basic-auth](plugins/basic-auth.md): User authentication based on Basic Authentication.
|
||||
* [authz-keycloak](plugins/authz-keycloak.md): Authorization with Keycloak Identity Server.
|
||||
* [wolf-rbac](plugins/wolf-rbac.md) User Authentication and Authorization based on *RBAC*.
|
||||
* [openid-connect](plugins/openid-connect.md)
|
||||
|
||||
### Security
|
||||
|
||||
* [cors](plugins/cors.md): Enable CORS(Cross-origin resource sharing) for your API.
|
||||
* [uri-blocker](plugins/uri-blocker.md): Block client request by URI.
|
||||
* [ip-restriction](plugins/ip-restriction.md): IP whitelist/blacklist.
|
||||
* [referer-restriction](plugins/referer-restriction.md): Referer whitelist.
|
||||
|
||||
### Traffic
|
||||
|
||||
* [limit-req](plugins/limit-req.md): Request rate limiting and adjustment based on the "leaky bucket" method.
|
||||
* [limit-conn](plugins/limit-conn.md): Limit request concurrency (or concurrent connections).
|
||||
* [limit-count](plugins/limit-count.md): Rate limiting based on a "fixed window" implementation.
|
||||
* [proxy-cache](plugins/proxy-cache.md): Provides the ability to cache upstream response data.
|
||||
* [request-validation](plugins/request-validation.md): Validates requests before forwarding to upstream.
|
||||
* [proxy-mirror](plugins/proxy-mirror.md): Provides the ability to mirror client requests.
|
||||
* [api-breaker](plugins/api-breaker.md): Circuit Breaker for API that stops requests forwarding to upstream in case of unhealthy state.
|
||||
* [traffic-split](plugins/traffic-split.md): Allows users to incrementally direct percentages of traffic between various upstreams.
|
||||
|
||||
### Monitoring
|
||||
|
||||
* [prometheus](plugins/prometheus.md): Expose metrics related to APISIX and proxied upstream services in Prometheus exposition format, which can be scraped by a Prometheus Server.
|
||||
* [OpenTracing](plugins/zipkin.md): Supports Zikpin and Apache SkyWalking.
|
||||
* [Skywalking](plugins/skywalking.md): Supports Apache SkyWalking.
|
||||
|
||||
### Loggers
|
||||
|
||||
* [http-logger](plugins/http-logger.md): Log requests to http servers.
|
||||
* [tcp-logger](plugins/tcp-logger.md): Log requests to TCP servers.
|
||||
* [kafka-logger](plugins/kafka-logger.md): Log requests to External Kafka servers.
|
||||
* [udp-logger](plugins/udp-logger.md): Log requests to UDP servers.
|
||||
* [sys-log](plugins/syslog.md): Log requests to Syslog.
|
||||
* [log-rotate](plugins/log-rotate.md): Rotate access/error log files.
|
||||
|
||||
## Deploy
|
||||
|
||||
### AWS
|
||||
|
||||
The recommended approach is to deploy APISIX with [AWS CDK](https://aws.amazon.com/cdk/) on [AWS Fargate](https://aws.amazon.com/fargate/) which helps you decouple the APISIX layer and the upstream layer on top of a fully-managed and secure serverless container compute environment with autoscaling capabilities.
|
||||
|
||||
### Kubernetes
|
||||
|
||||
See [this guide](../kubernetes/README.md) and learn how to deploy apisix in Kubernetes.
|
@ -23,18 +23,27 @@ title: Architecture Design
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [**APISIX**](#apisix)
|
||||
- [**APISIX Config**](#apisix-config)
|
||||
- [**Route**](#route)
|
||||
- [**Service**](#service)
|
||||
- [**Plugin**](#plugin)
|
||||
- [**Script**](#script)
|
||||
- [**Upstream**](#upstream)
|
||||
- [**Router**](#router)
|
||||
- [**Consumer**](#consumer-1)
|
||||
- [**Global Rule**](#global-rule)
|
||||
- [**Plugin Config**](#plugin-config)
|
||||
- [**Debug mode**](#debug-mode)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [APISIX](#apisix)
|
||||
- [Plugin Loading Process](#plugin-loading-process)
|
||||
- [Plugin Hierarchy Structure](#plugin-hierarchy-structure)
|
||||
- [APISIX Config](#apisix-config)
|
||||
- [Route](#route)
|
||||
- [Service](#service)
|
||||
- [Plugin](#plugin)
|
||||
- [Script](#script)
|
||||
- [Upstream](#upstream)
|
||||
- [Configuration](#configuration)
|
||||
- [Consumer](#consumer)
|
||||
- [Cookie](#cookie)
|
||||
- [Header](#header)
|
||||
- [Router](#router)
|
||||
- [Consumer](#consumer-1)
|
||||
- [Global Rule](#global-rule)
|
||||
- [Plugin Config](#plugin-config)
|
||||
- [Debug mode](#debug-mode)
|
||||
- [Basic Debug Mode](#basic-debug-mode)
|
||||
- [Advanced Debug Mode](#advanced-debug-mode)
|
||||
|
||||
## APISIX
|
||||
|
||||
@ -44,7 +53,7 @@ title: Architecture Design
|
||||
|
||||
### Plugin Hierarchy Structure
|
||||
|
||||
<img src="../../assets/images/flow-plugin-internal.png" width="50%" height="50%">
|
||||
<img src="../../assets/images/flow-plugin-internal.png" width="50%" height="50%" />
|
||||
|
||||
## APISIX Config
|
||||
|
||||
@ -54,7 +63,7 @@ For example, set the default listening port of APISIX to 8000, and keep other co
|
||||
|
||||
```yaml
|
||||
apisix:
|
||||
node_listen: 8000 # APISIX listening port
|
||||
node_listen: 8000 # APISIX listening port
|
||||
```
|
||||
|
||||
Set the default listening port of APISIX to 8000, set the `etcd` address to `http://foo:2379`,
|
||||
@ -62,15 +71,15 @@ and keep other configurations as default. The configuration in `config.yaml` sho
|
||||
|
||||
```yaml
|
||||
apisix:
|
||||
node_listen: 8000 # APISIX listening port
|
||||
node_listen: 8000 # APISIX listening port
|
||||
|
||||
etcd:
|
||||
host: "http://foo:2379" # etcd address
|
||||
host: "http://foo:2379" # etcd address
|
||||
```
|
||||
|
||||
Other default configurations can be found in the `conf/config-default.yaml` file, which is bound to the APISIX source code. **Never** manually modify the `conf/config-default.yaml` file. If you need to customize any configuration, you should update the `config.yaml` file.
|
||||
|
||||
**Note** `APISIX` will generate `conf/nginx.conf` file automatically, so please *DO NOT EDIT* `conf/nginx.conf` file too.
|
||||
**Note** `APISIX` will generate `conf/nginx.conf` file automatically, so please _DO NOT EDIT_ `conf/nginx.conf` file too.
|
||||
|
||||
[Back to top](#table-of-contents)
|
||||
|
||||
@ -82,7 +91,7 @@ The route mainly consists of three parts: matching rules (e.g uri, host, remote_
|
||||
|
||||
The following image shows an example of some Route rules. When some attribute values are the same, the figure is identified by the same color.
|
||||
|
||||
<img src="../../assets//images/routes-example.png" width="50%" height="50%">
|
||||
<img src="../../assets//images/routes-example.png" width="50%" height="50%" />
|
||||
|
||||
We configure all the parameters directly in the Route, it's easy to set up, and each Route has a relatively high degree of freedom. But when our Route has more repetitive configurations (such as enabling the same plugin configuration or upstream information), once we need update these same properties, we have to traverse all the Routes and modify them, so it's adding a lot of complexity of management and maintenance.
|
||||
|
||||
@ -122,7 +131,7 @@ For specific options of Route, please refer to [Admin API](admin-api.md#route).
|
||||
|
||||
A `Service` is an abstraction of an API (which can also be understood as a set of Route abstractions). It usually corresponds to the upstream service abstraction. Between `Route` and `Service`, usually the relationship of N:1, please see the following image.
|
||||
|
||||
<img src="../../assets/images/service-example.png" width="50%" height="50%">
|
||||
<img src="../../assets/images/service-example.png" width="50%" height="50%" />
|
||||
|
||||
Different Route rules are bound to a Service at the same time. These Routes will have the same upstream and plugin configuration, reducing redundant configuration.
|
||||
|
||||
@ -259,7 +268,7 @@ In theory, you can write arbitrary Lua code in `Script`, or you can directly cal
|
||||
|
||||
Upstream is a virtual host abstraction that performs load balancing on a given set of service nodes according to configuration rules. Upstream address information can be directly configured to `Route` (or `Service`). When Upstream has duplicates, you need to use "reference" to avoid duplication.
|
||||
|
||||
<img src="../../assets/images/upstream-example.png" width="50%" height="50%">
|
||||
<img src="../../assets/images/upstream-example.png" width="50%" height="50%" />
|
||||
|
||||
As shown in the image above, by creating an Upstream object and referencing it by ID in `Route`, you can ensure that only the value of an object is maintained.
|
||||
|
||||
@ -462,17 +471,18 @@ A distinguishing feature of APISIX from other API gateways is that it allows use
|
||||
|
||||
Set the route that best suits your business needs in the local configuration `conf/config.yaml`.
|
||||
|
||||
* `apisix.router.http`: HTTP Request Route。
|
||||
* `radixtree_uri`: (Default) only use `uri` as the primary index. Support for full and deep prefix matching based on the `radixtree` engine, see [How to use router-radixtree](router-radixtree.md).
|
||||
* `Absolute match`: Complete match for the given `uri`, such as `/foo/bar`,`/foo/glo`.
|
||||
* `Prefix match`: Use `*` at the end to represent the given `uri` as a prefix match. For example, `/foo*` allows matching `/foo/`, `/foo/a` and `/foo/b`.
|
||||
* `match priority`: first try absolute match, if you can't hit absolute match, try prefix match.
|
||||
* `Any filter attribute`: Allows you to specify any Nginx built-in variable as a filter, such as URL request parameters, request headers, cookies, and so on.
|
||||
* `radixtree_uri_with_parameter`: Like `radixtree_uri` but also support parameter match.
|
||||
* `radixtree_host_uri`: Use `host + uri` as the primary index (based on the `radixtree` engine), matching both host and URL for the current request.
|
||||
- `apisix.router.http`: HTTP Request Route。
|
||||
|
||||
* `apisix.router.ssl`: SSL loads the matching route.
|
||||
* `radixtree_sni`: (Default) Use `SNI` (Server Name Indication) as the primary index (based on the radixtree engine).
|
||||
- `radixtree_uri`: (Default) only use `uri` as the primary index. Support for full and deep prefix matching based on the `radixtree` engine, see [How to use router-radixtree](router-radixtree.md).
|
||||
- `Absolute match`: Complete match for the given `uri`, such as `/foo/bar`,`/foo/glo`.
|
||||
- `Prefix match`: Use `*` at the end to represent the given `uri` as a prefix match. For example, `/foo*` allows matching `/foo/`, `/foo/a` and `/foo/b`.
|
||||
- `match priority`: first try absolute match, if you can't hit absolute match, try prefix match.
|
||||
- `Any filter attribute`: Allows you to specify any Nginx built-in variable as a filter, such as URL request parameters, request headers, cookies, and so on.
|
||||
- `radixtree_uri_with_parameter`: Like `radixtree_uri` but also support parameter match.
|
||||
- `radixtree_host_uri`: Use `host + uri` as the primary index (based on the `radixtree` engine), matching both host and URL for the current request.
|
||||
|
||||
- `apisix.router.ssl`: SSL loads the matching route.
|
||||
- `radixtree_sni`: (Default) Use `SNI` (Server Name Indication) as the primary index (based on the radixtree engine).
|
||||
|
||||
[Back to top](#table-of-contents)
|
||||
|
||||
@ -480,7 +490,7 @@ Set the route that best suits your business needs in the local configuration `co
|
||||
|
||||
For the API gateway, it is usually possible to identify a certain type of requester by using a domain name such as a request domain name, a client IP address, etc., and then perform plugin filtering and forward the request to the specified upstream, but sometimes the depth is insufficient.
|
||||
|
||||
<img src="../../assets/images/consumer-who.png" width="50%" height="50%">
|
||||
<img src="../../assets/images/consumer-who.png" width="50%" height="50%" />
|
||||
|
||||
As shown in the image above, as an API gateway, you should know who the API Consumer is, so you can configure different rules for different API Consumers.
|
||||
|
||||
@ -491,7 +501,7 @@ As shown in the image above, as an API gateway, you should know who the API Cons
|
||||
|
||||
In APISIX, the process of identifying a Consumer is as follows:
|
||||
|
||||
<img src="../../assets/images/consumer-internal.png" width="50%" height="50%">
|
||||
<img src="../../assets/images/consumer-internal.png" width="50%" height="50%" />
|
||||
|
||||
1. Authorization certification: e.g [key-auth](./plugins/key-auth.md), [JWT](./plugins/jwt-auth.md), etc.
|
||||
2. Get consumer_name: By authorization, you can naturally get the corresponding Consumer `id`, which is the unique identifier of the Consumer object.
|
||||
@ -678,7 +688,7 @@ For example,
|
||||
}
|
||||
```
|
||||
|
||||
+
|
||||
- +
|
||||
|
||||
```
|
||||
{
|
||||
@ -783,19 +793,18 @@ Example:
|
||||
|
||||
```yaml
|
||||
hook_conf:
|
||||
enable: false # Enable/Disable Hook Debug Trace
|
||||
name: hook_phase # The Module List Name of Hook which has enabled Debug Trace
|
||||
log_level: warn # Logging Levels
|
||||
is_print_input_args: true # Enable/Disable Input Arguments Print
|
||||
is_print_return_value: true # Enable/Disable Returned Value Print
|
||||
enable: false # Enable/Disable Hook Debug Trace
|
||||
name: hook_phase # The Module List Name of Hook which has enabled Debug Trace
|
||||
log_level: warn # Logging Levels
|
||||
is_print_input_args: true # Enable/Disable Input Arguments Print
|
||||
is_print_return_value: true # Enable/Disable Returned Value Print
|
||||
|
||||
hook_phase: # Module Function List, Name: hook_phase
|
||||
apisix: # Referenced Module Name
|
||||
- http_access_phase # Function Names:Array
|
||||
hook_phase: # Module Function List, Name: hook_phase
|
||||
apisix: # Referenced Module Name
|
||||
- http_access_phase # Function Names:Array
|
||||
- http_header_filter_phase
|
||||
- http_body_filter_phase
|
||||
- http_log_phase
|
||||
|
||||
#END
|
||||
```
|
||||
|
||||
|
@ -37,13 +37,13 @@ and the response size was 1KB.
|
||||
|
||||
The x-axis means the size of CPU core, and the y-axis is QPS.
|
||||
|
||||
<img src="../../assets/images/benchmark-1.jpg" width="70%" height="70%">
|
||||
<img src="../../assets/images/benchmark-1.jpg" width="70%" height="70%" />
|
||||
|
||||
#### Latency
|
||||
|
||||
Note the y-axis latency in **microsecond(μs)** not millisecond.
|
||||
|
||||
<img src="../../assets/images/latency-1.jpg" width="70%" height="70%">
|
||||
<img src="../../assets/images/latency-1.jpg" width="70%" height="70%" />
|
||||
|
||||
#### Flame Graph
|
||||
|
||||
@ -82,13 +82,13 @@ and the response size was 1KB.
|
||||
|
||||
The x-axis means the size of CPU core, and the y-axis is QPS.
|
||||
|
||||
<img src="../../assets/images/benchmark-2.jpg" width="70%" height="70%">
|
||||
<img src="../../assets/images/benchmark-2.jpg" width="70%" height="70%" />
|
||||
|
||||
#### Latency
|
||||
|
||||
Note the y-axis latency in **microsecond(μs)** not millisecond.
|
||||
|
||||
<img src="../../assets/images/latency-2.jpg" width="70%" height="70%">
|
||||
<img src="../../assets/images/latency-2.jpg" width="70%" height="70%" />
|
||||
|
||||
#### Flame Graph
|
||||
|
||||
|
@ -1,4 +1,159 @@
|
||||
{
|
||||
"version": 2.3,
|
||||
"sidebar": {}
|
||||
"sidebar": [
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "architecture-design"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "getting-started"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "how-to-build"
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Plugins",
|
||||
"items": [
|
||||
{
|
||||
"type": "category",
|
||||
"label": "General",
|
||||
"items": [
|
||||
"plugins/batch-requests",
|
||||
"plugins/serverless",
|
||||
"plugins/redirect"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Transformation",
|
||||
"items": [
|
||||
"plugins/response-rewrite",
|
||||
"plugins/proxy-rewrite",
|
||||
"plugins/grpc-transcode",
|
||||
"plugins/fault-injection"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Authentication",
|
||||
"items": [
|
||||
"plugins/key-auth",
|
||||
"plugins/jwt-auth",
|
||||
"plugins/basic-auth",
|
||||
"plugins/authz-keycloak",
|
||||
"plugins/wolf-rbac",
|
||||
"plugins/openid-connect"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Security",
|
||||
"items": [
|
||||
"plugins/cors",
|
||||
"plugins/uri-blocker",
|
||||
"plugins/ip-restriction",
|
||||
"plugins/referer-restriction"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Traffic",
|
||||
"items": [
|
||||
"plugins/limit-req",
|
||||
"plugins/limit-conn",
|
||||
"plugins/limit-count",
|
||||
"plugins/proxy-cache",
|
||||
"plugins/request-validation",
|
||||
"plugins/proxy-mirror",
|
||||
"plugins/api-breaker",
|
||||
"plugins/traffic-split"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Monitoring",
|
||||
"items": [
|
||||
"plugins/prometheus",
|
||||
"plugins/zipkin",
|
||||
"plugins/skywalking"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Loggers",
|
||||
"items": [
|
||||
"plugins/http-logger",
|
||||
"plugins/tcp-logger",
|
||||
"plugins/kafka-logger",
|
||||
"plugins/udp-logger",
|
||||
"plugins/syslog",
|
||||
"plugins/log-rotate"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "admin-api"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "control-api"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "health-check"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "router-radixtree"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "stand-alone"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "stream-proxy"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "grpc-proxy"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "customize-nginx-configuration"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "dns"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "https"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "benchmark"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "CODE_STYLE"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "debug-function"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "FAQ"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "CHANGELOG"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: grpc-proxy
|
||||
title: gRPC Proxy
|
||||
---
|
||||
|
||||
<!--
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Build Apache APISIX
|
||||
title: How to build Apache APISIX
|
||||
---
|
||||
|
||||
<!--
|
||||
|
@ -35,13 +35,13 @@ Limiting request concurrency plugin.
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| ------------------ | ------- | ----------- | ------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| conn | integer | required | | conn > 0 | the maximum number of concurrent requests allowed. Requests exceeding this ratio (and below `conn` + `burst`) will get delayed to conform to this threshold. |
|
||||
| burst | integer | required | | burst >= 0 | the number of excessive concurrent requests (or connections) allowed to be delayed. |
|
||||
| default_conn_delay | number | required | | default_conn_delay > 0 | the default processing latency of a typical connection (or request). |
|
||||
| key | object | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | to limit the concurrency level. <br>For example, one can use the host name (or server zone) as the key so that we limit concurrency per host name. Otherwise, we can also use the client address as the key so that we can avoid a single client from flooding our service with too many parallel connections or requests. <br> Now accept those as key: "remote_addr"(client's IP), "server_addr"(server's IP), "X-Forwarded-For/X-Real-IP" in request header, "consumer_name"(consumer's username). |
|
||||
| rejected_code | string | optional | 503 | [200,...,599] | returned when the request exceeds `conn` + `burst` will be rejected. |
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| ------------------ | ------- | ----------- | ------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| conn | integer | required | | conn > 0 | the maximum number of concurrent requests allowed. Requests exceeding this ratio (and below `conn` + `burst`) will get delayed to conform to this threshold. |
|
||||
| burst | integer | required | | burst >= 0 | the number of excessive concurrent requests (or connections) allowed to be delayed. |
|
||||
| default_conn_delay | number | required | | default_conn_delay > 0 | the default processing latency of a typical connection (or request). |
|
||||
| key | object | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | to limit the concurrency level. <br />For example, one can use the host name (or server zone) as the key so that we limit concurrency per host name. Otherwise, we can also use the client address as the key so that we can avoid a single client from flooding our service with too many parallel connections or requests. <br /> Now accept those as key: "remote_addr"(client's IP), "server_addr"(server's IP), "X-Forwarded-For/X-Real-IP" in request header, "consumer_name"(consumer's username). |
|
||||
| rejected_code | string | optional | 503 | [200,...,599] | returned when the request exceeds `conn` + `burst` will be rejected. |
|
||||
|
||||
**Key can be customized by the user, only need to modify a line of code of the plug-in to complete. It is a security consideration that is not open in the plugin.**
|
||||
|
||||
@ -100,8 +100,8 @@ This means that the limit request concurrency plugin is in effect.
|
||||
## Disable Plugin
|
||||
|
||||
When you want to disable the limit-conn plugin, it is very simple,
|
||||
you can delete the corresponding json configuration in the plugin configuration,
|
||||
no need to restart the service, it will take effect immediately:
|
||||
you can delete the corresponding json configuration in the plugin configuration,
|
||||
no need to restart the service, it will take effect immediately:
|
||||
|
||||
```shell
|
||||
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
|
||||
|
@ -23,11 +23,11 @@ title: limit-connt
|
||||
|
||||
## Summary
|
||||
|
||||
- [Name](#name)
|
||||
- [Attributes](#attributes)
|
||||
- [How To Enable](#how-to-enable)
|
||||
- [Test Plugin](#test-plugin)
|
||||
- [Disable Plugin](#disable-plugin)
|
||||
- [Name](#name)
|
||||
- [Attributes](#attributes)
|
||||
- [How To Enable](#how-to-enable)
|
||||
- [Test Plugin](#test-plugin)
|
||||
- [Disable Plugin](#disable-plugin)
|
||||
|
||||
## Name
|
||||
|
||||
@ -35,21 +35,21 @@ Limit request rate by a fixed number of requests in a given time window.
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| -------------- | ------- | -------------------- | ------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| count | integer | required | | count > 0 | the specified number of requests threshold. |
|
||||
| time_window | integer | required | | time_window > 0 | the time window in seconds before the request count is reset. |
|
||||
| key | string | optional | "remote_addr" | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name", "service_id"] | The user specified key to limit the count. <br> Now accept those as key: "remote_addr"(client's IP), "server_addr"(server's IP), "X-Forwarded-For/X-Real-IP" in request header, "consumer_name"(consumer's username) and "service_id". |
|
||||
| rejected_code | integer | optional | 503 | [200,...,599] | The HTTP status code returned when the request exceeds the threshold is rejected, default 503. |
|
||||
| policy | string | optional | "local" | ["local", "redis", "redis-cluster"] | The rate-limiting policies to use for retrieving and incrementing the limits. Available values are `local`(the counters will be stored locally in-memory on the node) and `redis`(counters are stored on a Redis server and will be shared across the nodes, usually use it to do the global speed limit). |
|
||||
| redis_host | string | required for `redis` | | | When using the `redis` policy, this property specifies the address of the Redis server. |
|
||||
| redis_port | integer | optional | 6379 | [1,...] | When using the `redis` policy, this property specifies the port of the Redis server. |
|
||||
| redis_password | string | optional | | | When using the `redis` policy, this property specifies the password of the Redis server. |
|
||||
| redis_database | integer | optional | 0 | redis_database >= 0 | When using the `redis` policy, this property specifies the datatabase you selected of the Redis server, and only for non Redis cluster mode (single instance mode or Redis public cloud service that provides single entry). |
|
||||
| redis_timeout | integer | optional | 1000 | [1,...] | When using the `redis` policy, this property specifies the timeout in milliseconds of any command submitted to the Redis server. |
|
||||
| redis_cluster_nodes | array | optional | | | When using `redis-cluster` policy,This property is a list of addresses of Redis cluster service nodes. |
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| ------------------- | ------- | -------------------- | ------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| count | integer | required | | count > 0 | the specified number of requests threshold. |
|
||||
| time_window | integer | required | | time_window > 0 | the time window in seconds before the request count is reset. |
|
||||
| key | string | optional | "remote_addr" | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name", "service_id"] | The user specified key to limit the count. <br /> Now accept those as key: "remote_addr"(client's IP), "server_addr"(server's IP), "X-Forwarded-For/X-Real-IP" in request header, "consumer_name"(consumer's username) and "service_id". |
|
||||
| rejected_code | integer | optional | 503 | [200,...,599] | The HTTP status code returned when the request exceeds the threshold is rejected, default 503. |
|
||||
| policy | string | optional | "local" | ["local", "redis", "redis-cluster"] | The rate-limiting policies to use for retrieving and incrementing the limits. Available values are `local`(the counters will be stored locally in-memory on the node) and `redis`(counters are stored on a Redis server and will be shared across the nodes, usually use it to do the global speed limit). |
|
||||
| redis_host | string | required for `redis` | | | When using the `redis` policy, this property specifies the address of the Redis server. |
|
||||
| redis_port | integer | optional | 6379 | [1,...] | When using the `redis` policy, this property specifies the port of the Redis server. |
|
||||
| redis_password | string | optional | | | When using the `redis` policy, this property specifies the password of the Redis server. |
|
||||
| redis_database | integer | optional | 0 | redis_database >= 0 | When using the `redis` policy, this property specifies the datatabase you selected of the Redis server, and only for non Redis cluster mode (single instance mode or Redis public cloud service that provides single entry). |
|
||||
| redis_timeout | integer | optional | 1000 | [1,...] | When using the `redis` policy, this property specifies the timeout in milliseconds of any command submitted to the Redis server. |
|
||||
| redis_cluster_nodes | array | optional | | | When using `redis-cluster` policy,This property is a list of addresses of Redis cluster service nodes. |
|
||||
|
||||
**Key can be customized by the user, only need to modify a line of code of the plug-in to complete. It is a security consideration that is not open in the plugin.**
|
||||
**Key can be customized by the user, only need to modify a line of code of the plug-in to complete. It is a security consideration that is not open in the plugin.**
|
||||
|
||||
## How To Enable
|
||||
|
||||
@ -150,7 +150,7 @@ curl -i http://127.0.0.1:9080/index.html
|
||||
```
|
||||
|
||||
The response header contains `X-RateLimit-Limit` and `X-RateLimit-Remaining`,
|
||||
which mean the total number of requests and the remaining number of requests that can be sent:
|
||||
which mean the total number of requests and the remaining number of requests that can be sent:
|
||||
|
||||
```shell
|
||||
HTTP/1.1 200 OK
|
||||
@ -185,8 +185,8 @@ This means that the `limit count` plugin is in effect.
|
||||
## Disable Plugin
|
||||
|
||||
When you want to disable the `limit count` plugin, it is very simple,
|
||||
you can delete the corresponding json configuration in the plugin configuration,
|
||||
no need to restart the service, it will take effect immediately:
|
||||
you can delete the corresponding json configuration in the plugin configuration,
|
||||
no need to restart the service, it will take effect immediately:
|
||||
|
||||
```shell
|
||||
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
|
||||
|
@ -110,7 +110,7 @@ plugin_attr:
|
||||
|
||||
Metrics exported by the plugin can be graphed in Grafana using a drop in dashboard.
|
||||
|
||||
Downloads [Grafana dashboard meta](../json/apisix-grafana-dashboard.json) and imports it to Grafana。
|
||||
Downloads [Grafana dashboard meta](../../../assets/other/json/apisix-grafana-dashboard.json) and imports it to Grafana。
|
||||
|
||||
Or you can goto [Grafana official](https://grafana.com/grafana/dashboards/11719) for `Grafana` meta data.
|
||||
|
||||
|
@ -44,7 +44,7 @@ Both plug-ins receive the same parameters.
|
||||
| phase | string | optional | ["access"] | ["rewrite", "access", "header_filter", "body_filter", "log", "balancer"] | |
|
||||
| functions | array[string] | required | | | A list of functions that are specified to run is an array type, which can contain either one function or multiple functions, executed sequentially. |
|
||||
|
||||
Note that only function is accepted here, not other types of Lua code. For example, anonymous functions are legal:<br>
|
||||
Note that only function is accepted here, not other types of Lua code. For example, anonymous functions are legal:<br />
|
||||
|
||||
```lua
|
||||
return function()
|
||||
@ -94,7 +94,7 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f03433
|
||||
|
||||
## Test Plugin
|
||||
|
||||
Use curl to access:
|
||||
Use curl to access:
|
||||
|
||||
```shell
|
||||
curl -i http://127.0.0.1:9080/index.html
|
||||
@ -106,8 +106,8 @@ which indicates that the specified function is in effect.
|
||||
## Disable Plugin
|
||||
|
||||
When you want to disable the serverless plugin, it is very simple,
|
||||
you can delete the corresponding json configuration in the plugin configuration,
|
||||
no need to restart the service, it will take effect immediately:
|
||||
you can delete the corresponding json configuration in the plugin configuration,
|
||||
no need to restart the service, it will take effect immediately:
|
||||
|
||||
```shell
|
||||
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
|
||||
|
@ -71,7 +71,7 @@ Users are encouraged to add themselves to this page, [issue](https://github.com/
|
||||
1. <a href="https://www.zuzuche.com/" rel="nofollow">zuzuche 租租车</a>
|
||||
1. <a href="https://www.zybang.com/" rel="nofollow">zybang 作业帮</a>
|
||||
|
||||
<img src="https://raw.githubusercontent.com/iresty/iresty.com/master/user-wall.jpg" width="900" height="500">
|
||||
<img src="https://raw.githubusercontent.com/iresty/iresty.com/master/user-wall.jpg" width="900" height="500" />
|
||||
|
||||
## User Cases
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: libradixtree
|
||||
title: Router radixtree
|
||||
---
|
||||
|
||||
<!--
|
||||
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: Apache APISIX
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,8 +21,6 @@
|
||||
#
|
||||
-->
|
||||
|
||||
# Apache APISIX
|
||||
|
||||
<img src="https://svn.apache.org/repos/asf/comdev/project-logos/originals/apisix.svg" alt="APISIX logo" height="150px" align="right" />
|
||||
|
||||
[![Build Status](https://github.com/apache/apisix/workflows/build/badge.svg?branch=master)](https://github.com/apache/apisix/actions)
|
||||
@ -34,7 +36,7 @@ También puede usarse como [k8s ingress controller (control de ingreso)](https:/
|
||||
|
||||
La arquitectura técnica de Apache APISIX:
|
||||
|
||||
![](docs/assets/images/apisix.png)
|
||||
![](../../assets/images/apisix.png)
|
||||
|
||||
## Communidad
|
||||
|
||||
@ -65,75 +67,75 @@ ensayos A/B, ensayos de despliegue de canarios (canary release), despliegue azul
|
||||
|
||||
- **Multi protocolos**
|
||||
|
||||
- [Proxy TCP/UDP](docs/en/latest/stream-proxy.md): Proxy TCP/UDP dinámico.
|
||||
- [Proxy Dubbo](docs/en/latest/plugins/dubbo-proxy.md): Proxy dinámico HTTP a Dubbo.
|
||||
- [Proxy MQTT Dinámico](docs/en/latest/plugins/mqtt-proxy.md): Soporte de balance de carga MQTT por `client_id`, soporta ambos MQTT [3.1.\*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html), [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
|
||||
- [Proxy gRPC](docs/en/latest/grpc-proxy.md): Tráfico gRPC a través de Proxy.
|
||||
- [Transcodificado gRPC](docs/en/latest/plugins/grpc-transcode.md): Soporta transcodificado de protocolo para que los clientes puedan acceder su gRPC API usando HTTP/JSON.
|
||||
- [Proxy TCP/UDP](stream-proxy.md): Proxy TCP/UDP dinámico.
|
||||
- [Proxy Dubbo](plugins/dubbo-proxy.md): Proxy dinámico HTTP a Dubbo.
|
||||
- [Proxy MQTT Dinámico](plugins/mqtt-proxy.md): Soporte de balance de carga MQTT por `client_id`, soporta ambos MQTT [3.1.\*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html), [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
|
||||
- [Proxy gRPC](grpc-proxy.md): Tráfico gRPC a través de Proxy.
|
||||
- [Transcodificado gRPC](plugins/grpc-transcode.md): Soporta transcodificado de protocolo para que los clientes puedan acceder su gRPC API usando HTTP/JSON.
|
||||
- Proxy de Websocket
|
||||
- Proxy de Protocolo
|
||||
- Proxy Dubbo: Proxy de Dubbo basado en Tengine.
|
||||
- Proxy de HTTP(S) hacia adelante
|
||||
- [SSL](docs/en/latest/https.md): Carga dinámica de certificado SSL.
|
||||
- [SSL](https.md): Carga dinámica de certificado SSL.
|
||||
|
||||
- **Completamente Dinámico**
|
||||
|
||||
- [Las actualizaciones y los plugins más recientes](docs/en/latest/plugins.md): Actualiza sus configuraciones y plugins sin reinicios!
|
||||
- [Reescritura de proxy](docs/en/latest/plugins/proxy-rewrite.md): Soporta la reescritura de `host`, `uri`, `schema`, `enable_websocket`, `headers` para el request antes de reenviarlo aguas arriba (upstream).
|
||||
- [Reescritura de respuesta](docs/en/latest/plugins/response-rewrite.md): Establece el código de estatus de respuesta personalizado, así como el cuerpo y el encabezado para el cliente.
|
||||
- [Sin servidor (serverless)](docs/en/latest/plugins/serverless.md): Invoque funciones en cada fase en APISIX.
|
||||
- [Las actualizaciones y los plugins más recientes](plugins.md): Actualiza sus configuraciones y plugins sin reinicios!
|
||||
- [Reescritura de proxy](plugins/proxy-rewrite.md): Soporta la reescritura de `host`, `uri`, `schema`, `enable_websocket`, `headers` para el request antes de reenviarlo aguas arriba (upstream).
|
||||
- [Reescritura de respuesta](plugins/response-rewrite.md): Establece el código de estatus de respuesta personalizado, así como el cuerpo y el encabezado para el cliente.
|
||||
- [Sin servidor (serverless)](plugins/serverless.md): Invoque funciones en cada fase en APISIX.
|
||||
- Balance dinámico de cargas: Balanceo de cargas Round-robin usando pesos.
|
||||
- Balance de cargas basado en Hash: Balanceo de cargas con sesiones de hashing consistentes.
|
||||
- [Comprobaciones del sistema](docs/en/latest/health-check.md): Permite comprobaciones del sistema en el nodo aguas arriba, y automáticamente filtrará nodos problemáticos durante el balanceo de cargas para asegurar la estabilidad del sistema.
|
||||
- [Comprobaciones del sistema](health-check.md): Permite comprobaciones del sistema en el nodo aguas arriba, y automáticamente filtrará nodos problemáticos durante el balanceo de cargas para asegurar la estabilidad del sistema.
|
||||
- Interruptor del circuito: Rastreo inteligente de servicios aguas arriba que tengan problemas.
|
||||
- [Reflejo de proxy (mirror)](docs/en/latest/plugins/proxy-mirror.md): Proporciona la capacidad de reflejar (mirror) los request (solicitudes) del cliente.
|
||||
- [Bifurcación de tráfico](docs/en/latest/plugins/traffic-split.md): Permite a los usuarios dirigir de manera creciente porciones del tráfico entre varias corrientes aguas arriba (upstreams).
|
||||
- [Reflejo de proxy (mirror)](plugins/proxy-mirror.md): Proporciona la capacidad de reflejar (mirror) los request (solicitudes) del cliente.
|
||||
- [Bifurcación de tráfico](plugins/traffic-split.md): Permite a los usuarios dirigir de manera creciente porciones del tráfico entre varias corrientes aguas arriba (upstreams).
|
||||
|
||||
- **Enrutamiento con control fino (fine grain)**
|
||||
|
||||
- [Soporta correspondencia completa de la ruta y correspondencia del prefijo](docs/en/latest/router-radixtree.md#how-to-use-libradixtree-in-apisix)
|
||||
- [Soporta todas las variables integradas en Nginx como condiciones para el enrutamiento](/docs/en/latest/router-radixtree.md#how-to-filter-route-by-nginx-builtin-variable), así que pueden usarse `cookie`, `args`, etc. como condiciones de enrutamiento para implementar ensayos de desplegado de canarios, ensayoss A/B, etc.
|
||||
- [Soporta correspondencia completa de la ruta y correspondencia del prefijo](router-radixtree.md#how-to-use-libradixtree-in-apisix)
|
||||
- [Soporta todas las variables integradas en Nginx como condiciones para el enrutamiento](/router-radixtree.md#how-to-filter-route-by-nginx-builtin-variable), así que pueden usarse `cookie`, `args`, etc. como condiciones de enrutamiento para implementar ensayos de desplegado de canarios, ensayoss A/B, etc.
|
||||
- Soporta [varios operadores como condiciones de juicio para el enrutamiento](https://github.com/iresty/lua-resty-radixtree#operator-list), por ejemplo `{"arg_age", ">", 24}`
|
||||
- Soporta [función personalizada de correspondencia de ruta](https://github.com/iresty/lua-resty-radixtree/blob/master/t/filter-fun.t#L10)
|
||||
- IPv6: Usar IPv6 para hacer corresponder la ruta.
|
||||
- Soporta [TTL](docs/en/latest/admin-api.md#route)
|
||||
- [Soporta prioridades](docs/en/latest/router-radixtree.md#3-match-priority)
|
||||
- [Soporta solicitudes Batch Http (por lotes)](docs/en/latest/plugins/batch-requests.md)
|
||||
- Soporta [TTL](admin-api.md#route)
|
||||
- [Soporta prioridades](router-radixtree.md#3-match-priority)
|
||||
- [Soporta solicitudes Batch Http (por lotes)](plugins/batch-requests.md)
|
||||
|
||||
- **Seguridad**
|
||||
|
||||
- Autenticaciones: [key-auth](docs/en/latest/plugins/key-auth.md), [JWT](docs/en/latest/plugins/jwt-auth.md), [basic-auth](docs/en/latest/plugins/basic-auth.md), [wolf-rbac](docs/en/latest/plugins/wolf-rbac.md)
|
||||
- [IP Whitelist/Blacklist](docs/en/latest/plugins/ip-restriction.md)
|
||||
- [Referente Whitelist/Blacklist (listas blancas y negras)](docs/en/latest/plugins/referer-restriction.md)
|
||||
- [IdP](docs/en/latest/plugins/openid-connect.md): Soporta servicios externos de autenticación, tales como Auth0, okta, etc., los usuarios pueden usar esto para conectarse a OAuth 2.0 y otros métodos de autenticación.
|
||||
- [Límite de procesamiento de solicitudes (Limit-req)](docs/en/latest/plugins/limit-req.md)
|
||||
- [Límite de contador (Limit-count)](docs/en/latest/plugins/limit-count.md)
|
||||
- [Límite de concurrencia (Limit-concurrency)](docs/en/latest/plugins/limit-conn.md)
|
||||
- Autenticaciones: [key-auth](plugins/key-auth.md), [JWT](plugins/jwt-auth.md), [basic-auth](plugins/basic-auth.md), [wolf-rbac](plugins/wolf-rbac.md)
|
||||
- [IP Whitelist/Blacklist](plugins/ip-restriction.md)
|
||||
- [Referente Whitelist/Blacklist (listas blancas y negras)](plugins/referer-restriction.md)
|
||||
- [IdP](plugins/openid-connect.md): Soporta servicios externos de autenticación, tales como Auth0, okta, etc., los usuarios pueden usar esto para conectarse a OAuth 2.0 y otros métodos de autenticación.
|
||||
- [Límite de procesamiento de solicitudes (Limit-req)](plugins/limit-req.md)
|
||||
- [Límite de contador (Limit-count)](plugins/limit-count.md)
|
||||
- [Límite de concurrencia (Limit-concurrency)](plugins/limit-conn.md)
|
||||
- Anti-ReDoS (Negación regular del servicio): políticas integradas para Anti ReDoS sin configuración.
|
||||
- [CORS](docs/en/latest/plugins/cors.md) Activa CORS (Compartir recursos de origen cruzado) para su API.
|
||||
- [Bloqueador URI](docs/en/latest/plugins/uri-blocker.md): Bloquea solicitudes del cliente por URI.
|
||||
- [Validador de solicitudes (Request Validator)](docs/en/latest/plugins/request-validation.md)
|
||||
- [CORS](plugins/cors.md) Activa CORS (Compartir recursos de origen cruzado) para su API.
|
||||
- [Bloqueador URI](plugins/uri-blocker.md): Bloquea solicitudes del cliente por URI.
|
||||
- [Validador de solicitudes (Request Validator)](plugins/request-validation.md)
|
||||
|
||||
- **OPS amigable**
|
||||
|
||||
- OpenTracing (rastreo abierto): Soporta [Apache Skywalking](docs/en/latest/plugins/skywalking.md) y [Zipkin](docs/en/latest/plugins/zipkin.md)
|
||||
- Trabaja con descubrimiento de servicio externo:Aparte del etcd integrado (Equipo Terminal del Circuito de Datos), también soporta `Consul` y `Nacos` [DNS en modo descubrimiento](https://github.com/apache/apisix/issues/1731#issuecomment-646392129), y [Eureka](docs/en/latest/discovery.md)
|
||||
- Monitoreo y métrica (control de mediciones): [Prometheus](docs/en/latest/plugins/prometheus.md)
|
||||
- OpenTracing (rastreo abierto): Soporta [Apache Skywalking](plugins/skywalking.md) y [Zipkin](plugins/zipkin.md)
|
||||
- Trabaja con descubrimiento de servicio externo:Aparte del etcd integrado (Equipo Terminal del Circuito de Datos), también soporta `Consul` y `Nacos` [DNS en modo descubrimiento](https://github.com/apache/apisix/issues/1731#issuecomment-646392129), y [Eureka](discovery.md)
|
||||
- Monitoreo y métrica (control de mediciones): [Prometheus](plugins/prometheus.md)
|
||||
- Agrupación (clustering): Nodos APISIX sin estados, crea agrupaciones del centro de configuración, por favor consultar [etcd Clustering Guide](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/clustering.md).
|
||||
- Alta disponibilidad: Soporta configurar múltiples direcciones etcd en el mismo grupo (cluster).
|
||||
- [Tablero](https://github.com/apache/apisix-dashboard)
|
||||
- Control de versión: Soporta retroceso o deshacer de operaciones.
|
||||
- CLI: comenzar\detenerse\recargar APISIX usando la línea de comando.
|
||||
- [Modo stand-alone (por su cuenta)](docs/en/latest/stand-alone.md): Soporta cargar reglas de ruta desde un archivo local yaml, siendo más amigable que kubernetes(k8s).
|
||||
- [Regla global](docs/en/latest/architecture-design.md#global-rule): Permite ejecutar cualquier plugin para todas las solicitudes, como: limit rate, IP filter etc.
|
||||
- [Modo stand-alone (por su cuenta)](stand-alone.md): Soporta cargar reglas de ruta desde un archivo local yaml, siendo más amigable que kubernetes(k8s).
|
||||
- [Regla global](architecture-design.md#global-rule): Permite ejecutar cualquier plugin para todas las solicitudes, como: limit rate, IP filter etc.
|
||||
- Alto desempeño: El QPS de un sólo núcleo alcanza 18k con un retraso promedio de menos de 0.2 milisegundos.
|
||||
- [Fault Injection](docs/en/latest/plugins/fault-injection.md)
|
||||
- [REST Admin API](docs/en/latest/admin-api.md): Al usar REST Admin API para controlar Apache APISIX, el cual solamente permite acceso 127.0.0.1 por defecto, usted puede modificar el campo `allow_admin` en `conf/config.yaml` para especificar una lista de IPs a los que se les permite llamar el Admin API. Nótese también que el Admin API utiliza autentificación de clave (key auth) para verificar la identidad de quien llama. **El campo `admin_key` en `conf/config.yaml` debe ser modificado antes del despliegue para asegurar la seguridad**.
|
||||
- Loggers (accesos de registro) externos: Exporte accesos de registro para herramientas de control de acceso externo. ([HTTP Logger](docs/en/latest/plugins/http-logger.md), [TCP Logger](docs/en/latest/plugins/tcp-logger.md), [Kafka Logger](docs/en/latest/plugins/kafka-logger.md), [UDP Logger](docs/en/latest/plugins/udp-logger.md))
|
||||
- [Fault Injection](plugins/fault-injection.md)
|
||||
- [REST Admin API](admin-api.md): Al usar REST Admin API para controlar Apache APISIX, el cual solamente permite acceso 127.0.0.1 por defecto, usted puede modificar el campo `allow_admin` en `conf/config.yaml` para especificar una lista de IPs a los que se les permite llamar el Admin API. Nótese también que el Admin API utiliza autentificación de clave (key auth) para verificar la identidad de quien llama. **El campo `admin_key` en `conf/config.yaml` debe ser modificado antes del despliegue para asegurar la seguridad**.
|
||||
- Loggers (accesos de registro) externos: Exporte accesos de registro para herramientas de control de acceso externo. ([HTTP Logger](plugins/http-logger.md), [TCP Logger](plugins/tcp-logger.md), [Kafka Logger](plugins/kafka-logger.md), [UDP Logger](plugins/udp-logger.md))
|
||||
- [Cartas Helm](https://github.com/apache/apisix-helm-chart)
|
||||
|
||||
- **Altamente escalable**
|
||||
- [Plugins personalizados](docs/en/latest/plugin-develop.md): Permite engancharse en fases comunes, tales como `rewrite`, `access`, `header filer`, `body filter` y `log`, y también permite engancharse en la etapa `balancer`.
|
||||
- [Plugins personalizados](plugin-develop.md): Permite engancharse en fases comunes, tales como `rewrite`, `access`, `header filer`, `body filter` y `log`, y también permite engancharse en la etapa `balancer`.
|
||||
- Carga personalizada de algoritmos de balanceo: Usted puede cargar los algoritmos de balanceo de manera personalizada durante la fase de `balancer`.
|
||||
- Routing personalizado: Soporta que los usuarios implementen algoritmos de enrutamiento por sí mismos.
|
||||
|
||||
@ -148,7 +150,8 @@ CentOS 7, Ubuntu 16.04, Ubuntu 18.04, Debian 9, Debian 10, macOS, **ARM64** Ubun
|
||||
Hay varias maneras de instalar la versión publicada Apache de APISIX:
|
||||
|
||||
1. Compilación de código fuente (aplicable a todos los sistemas)
|
||||
- Instalación de dependencias en tiempo de ejecución: OpenResty y etcd, y dependencias de compilación: luarocks. Consultar [install dependencies documentation](docs/en/latest/install-dependencies.md)
|
||||
|
||||
- Instalación de dependencias en tiempo de ejecución: OpenResty y etcd, y dependencias de compilación: luarocks. Consultar [install dependencies documentation](install-dependencies.md)
|
||||
- Bajar el paquete de publicación más reciente de código fuente:
|
||||
|
||||
```shell
|
||||
@ -186,7 +189,8 @@ Hay varias maneras de instalar la versión publicada Apache de APISIX:
|
||||
La imagen del contenedor Docker no incluye `etcd`, usted puede consultar [docker compose example](https://github.com/apache/apisix-docker/tree/master/example) para iniciar un grupo de ensayos.
|
||||
|
||||
3. Paquete RPM(sólo para CentOS 7)
|
||||
- Instalación de dependencias en tiempo de ejecución: Librerías de desarrollo OpenResty, etcd y OpenSSL, consultar [install dependencies documentation](docs/en/latest/install-dependencies.md#centos-7)
|
||||
|
||||
- Instalación de dependencias en tiempo de ejecución: Librerías de desarrollo OpenResty, etcd y OpenSSL, consultar [install dependencies documentation](install-dependencies.md#centos-7)
|
||||
- Instalar APISIX:
|
||||
|
||||
```shell
|
||||
@ -229,21 +233,21 @@ Hay varias maneras de instalar la versión publicada Apache de APISIX:
|
||||
|
||||
2. Comenzando
|
||||
|
||||
La Guía para Comenzar es una excelente manera de aprender los fundamentos de APISIX, basta seguir los pasos en [Getting Started](docs/en/latest/getting-started.md).
|
||||
La Guía para Comenzar es una excelente manera de aprender los fundamentos de APISIX, basta seguir los pasos en [Getting Started](getting-started.md).
|
||||
|
||||
Más aún, usted puede seguir la documentación para ensayar más [plugins](docs/en/latest/README.md#plugins).
|
||||
Más aún, usted puede seguir la documentación para ensayar más [plugins](README.md#plugins).
|
||||
|
||||
3. Admin API
|
||||
|
||||
Apache APISIX brinda [REST Admin API](docs/en/latest/admin-api.md) para controlar de forma dinámica el grupo (cluster) Apache APISIX.
|
||||
Apache APISIX brinda [REST Admin API](admin-api.md) para controlar de forma dinámica el grupo (cluster) Apache APISIX.
|
||||
|
||||
4. Desarrollo de Plugin
|
||||
|
||||
Usted puede consultar la guía [plugin development guide](docs/en/latest/plugin-develop.md), y la documentación e implementación de código [sample plugin `echo`](docs/en/latest/plugins/echo.md).
|
||||
Usted puede consultar la guía [plugin development guide](plugin-develop.md), y la documentación e implementación de código [sample plugin `echo`](plugins/echo.md).
|
||||
|
||||
Por favor note que los plugins de Apache APISIX added, updated, deleted, etc. no son cargados sin reiniciar el servicio.
|
||||
|
||||
Para más documentación, por favor visitar [Apache APISIX Document Index](docs/en/latest/README.md)
|
||||
Para más documentación, por favor visitar [Apache APISIX Document Index](README.md)
|
||||
|
||||
## Evaluación comparativa (Benchmark)
|
||||
|
||||
@ -256,40 +260,40 @@ Al usar el servidor de 8 núcleos de AWS, los QPS de APISIX alcanzan 140,000 con
|
||||
#### Ambos han sido cubiertos en cuanto a prestaciones del núcleo del portal (gateway) API
|
||||
|
||||
| **Prestaciones** | **Apache APISIX** | **KONG** |
|
||||
| :------------------- | :---------------- | :------- |
|
||||
| **Upstream dinámico** | Sí | Sí |
|
||||
| **Router dinámico** | Sí | Sí |
|
||||
| **Chequeo del sistema** | Sí | Sí |
|
||||
| **SSL dinámico** | Sí | Sí |
|
||||
| **Proxy L4 y L7** | Sí | Sí |
|
||||
| **Rastreo abierto** | Sí | Sí |
|
||||
| **Plugin personalizado** | Sí | Sí |
|
||||
| **REST API** | Sí | Sí |
|
||||
| **CLI** | Sí | Sí |
|
||||
| :----------------------- | :---------------- | :------- |
|
||||
| **Upstream dinámico** | Sí | Sí |
|
||||
| **Router dinámico** | Sí | Sí |
|
||||
| **Chequeo del sistema** | Sí | Sí |
|
||||
| **SSL dinámico** | Sí | Sí |
|
||||
| **Proxy L4 y L7** | Sí | Sí |
|
||||
| **Rastreo abierto** | Sí | Sí |
|
||||
| **Plugin personalizado** | Sí | Sí |
|
||||
| **REST API** | Sí | Sí |
|
||||
| **CLI** | Sí | Sí |
|
||||
|
||||
#### Las ventajas de Apache APISIX
|
||||
|
||||
| **Prestaciones** | **Apache APISIX** | **Kong** |
|
||||
| :-------------------------------------------------------------- | :------------------------------------------------ | :---------------------- |
|
||||
| Le pertenece a | Apache Software Foundation | Kong Inc. |
|
||||
| Arquitectura de la tecnología | Nginx + etcd | Nginx + postgres |
|
||||
| Canales de comunicación | Lista de correos, grupo Wechat, grupo QQ, GitHub, meetup | GitHub, freenode, foro |
|
||||
| CPU de un solo núcleo, QPS (activa limit-count y plugins prometheus) | 18000 | 1700 |
|
||||
| Latencia | 0.2 ms | 2 ms |
|
||||
| Dubbo | Sí | No |
|
||||
| Retroceso-deshacer de configuration | Sí | No |
|
||||
| Ruta con TTL | Sí | No |
|
||||
| Plug-in carga en caliente | Sí | No |
|
||||
| LB y ruta personalizados | Sí | No |
|
||||
| REST API <--> transcodificación gRPC | Sí | No |
|
||||
| Tengine | Sí | No |
|
||||
| MQTT | Sí | No |
|
||||
| Tiempo efectivo de Configuración | Determinado por los eventos, < 1ms | Recabando datos, 5 seg |
|
||||
| Tablero | Sí | No |
|
||||
| IdP | Sí | No |
|
||||
| Centro de configuración HA | Sí | No |
|
||||
| Límite de velocidad para una ventana específica de tiempo | Sí | No |
|
||||
| Soporta cualquier variable Nginx como condición de enrutamiento | Sí | No |
|
||||
| **Prestaciones** | **Apache APISIX** | **Kong** |
|
||||
| :------------------------------------------------------------------- | :------------------------------------------------------- | :--------------------- |
|
||||
| Le pertenece a | Apache Software Foundation | Kong Inc. |
|
||||
| Arquitectura de la tecnología | Nginx + etcd | Nginx + postgres |
|
||||
| Canales de comunicación | Lista de correos, grupo Wechat, grupo QQ, GitHub, meetup | GitHub, freenode, foro |
|
||||
| CPU de un solo núcleo, QPS (activa limit-count y plugins prometheus) | 18000 | 1700 |
|
||||
| Latencia | 0.2 ms | 2 ms |
|
||||
| Dubbo | Sí | No |
|
||||
| Retroceso-deshacer de configuration | Sí | No |
|
||||
| Ruta con TTL | Sí | No |
|
||||
| Plug-in carga en caliente | Sí | No |
|
||||
| LB y ruta personalizados | Sí | No |
|
||||
| REST API <--> transcodificación gRPC | Sí | No |
|
||||
| Tengine | Sí | No |
|
||||
| MQTT | Sí | No |
|
||||
| Tiempo efectivo de Configuración | Determinado por los eventos, < 1ms | Recabando datos, 5 seg |
|
||||
| Tablero | Sí | No |
|
||||
| IdP | Sí | No |
|
||||
| Centro de configuración HA | Sí | No |
|
||||
| Límite de velocidad para una ventana específica de tiempo | Sí | No |
|
||||
| Soporta cualquier variable Nginx como condición de enrutamiento | Sí | No |
|
||||
|
||||
Ensayo de comparación de desempeño [datos detallados](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)
|
||||
|
||||
@ -317,15 +321,15 @@ Ensayo de comparación de desempeño [datos detallados](https://gist.github.com/
|
||||
|
||||
Una gran variedad de compañías y organizacioes usan APISIX para investigación, producción y productos comerciales, incluyendo:
|
||||
|
||||
<img src="https://raw.githubusercontent.com/api7/website-of-API7/master/user-wall.jpg" width="900" height="500">
|
||||
<img src="https://raw.githubusercontent.com/api7/website-of-API7/master/user-wall.jpg" width="900" height="500" />
|
||||
|
||||
Se alienta a los usuarios a sumarse a la página [Powered By](docs/en/latest/powered-by.md).
|
||||
Se alienta a los usuarios a sumarse a la página [Powered By](powered-by.md).
|
||||
|
||||
## Landscape (panorama)
|
||||
|
||||
<p align="left">
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200">
|
||||
<br><br>
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150" /> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200" />
|
||||
<br /><br />
|
||||
APISIX enriquece el <a href="https://landscape.cncf.io/card-mode?category=api-gateway&grouping=category">
|
||||
CNCF API Gateway Landscape.</a>
|
||||
</p>
|
4
docs/es/latest/config.json
Normal file
4
docs/es/latest/config.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"version": 2.3,
|
||||
"sidebar": []
|
||||
}
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: CHANGELOG
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,7 +21,7 @@
|
||||
#
|
||||
-->
|
||||
|
||||
# Table of Contents
|
||||
## Table of Contents
|
||||
|
||||
- [2.3.0](#230)
|
||||
- [2.2.0](#220)
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: APISIX Lua 编码风格指南
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,10 +21,6 @@
|
||||
#
|
||||
-->
|
||||
|
||||
[English](CODE_STYLE.md)
|
||||
|
||||
# APISIX Lua 编码风格指南
|
||||
|
||||
## 缩进
|
||||
|
||||
使用 4 个空格作为缩进的标记:
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: 常见问题
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,8 +21,6 @@
|
||||
#
|
||||
-->
|
||||
|
||||
# 常见问题
|
||||
|
||||
## 为什么要做 API 网关?不是已经有其他的开源网关了吗?
|
||||
|
||||
微服务领域对 API 网关有新的需求:更高的灵活性、更高的性能要求,以及云原生的贴合。
|
||||
@ -32,7 +34,7 @@ APISIX 基于 etcd 来完成配置的保存和同步,而不是 postgres 或者
|
||||
|
||||
## APISIX 的性能怎么样?
|
||||
|
||||
APISIX 设计和开发的目标之一,就是业界最高的性能。具体测试数据见这里:[benchmark](https://github.com/apache/apisix/blob/master/docs/zh/latest/benchmark.md)
|
||||
APISIX 设计和开发的目标之一,就是业界最高的性能。具体测试数据见这里:[benchmark](https://github.com/apache/apisix/blob/master/benchmark.md)
|
||||
|
||||
APISIX 是当前性能最好的 API 网关,单核 QPS 达到 2.3 万,平均延时仅有 0.6 毫秒。
|
||||
|
||||
@ -44,7 +46,7 @@ APISIX 是当前性能最好的 API 网关,单核 QPS 达到 2.3 万,平均
|
||||
|
||||
当然可以,APISIX 提供了灵活的自定义插件,方便开发者和企业编写自己的逻辑。
|
||||
|
||||
[如何开发插件](docs/zh/latest/plugin-develop.md)
|
||||
[如何开发插件](plugin-develop.md)
|
||||
|
||||
## 我们为什么选择 etcd 作为配置中心?
|
||||
|
||||
@ -116,7 +118,7 @@ https://github.com/iresty/lua-resty-radixtree#operator-list
|
||||
|
||||
2、通过 traffic-split 插件来实现
|
||||
|
||||
详细使用示例请参考 [traffic-split.md](docs/zh/latest/plugins/traffic-split.md) 插件文档。
|
||||
详细使用示例请参考 [traffic-split.md](plugins/traffic-split.md) 插件文档。
|
||||
|
||||
## 如何支持 http 自动跳转到 https?
|
||||
|
||||
@ -219,7 +221,7 @@ Server: APISIX web server
|
||||
|
||||
Apache APISIX 的插件支持热加载。
|
||||
|
||||
具体怎么做参考 [插件](./docs/zh/latest/plugins.md) 中关于“热加载”的部分。
|
||||
具体怎么做参考 [插件](./plugins.md) 中关于“热加载”的部分。
|
||||
|
||||
## 如何让 APISIX 在处理 HTTP 或 HTTPS 请求时监听多个端口
|
||||
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
title: Apache APISIX
|
||||
---
|
||||
|
||||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -17,92 +21,337 @@
|
||||
#
|
||||
-->
|
||||
|
||||
## 参考文档
|
||||
<img src="https://svn.apache.org/repos/asf/comdev/project-logos/originals/apisix.svg" alt="APISIX logo" height="150px" align="right" />
|
||||
|
||||
* [APISIX 说明](../../README_CN.md)
|
||||
* [架构设计](architecture-design.md)
|
||||
* [如何构建 Apache APISIX](how-to-build.md)
|
||||
* [管理 API](admin-api.md)
|
||||
* [控制 API](../control-api.md)
|
||||
* [健康检查](health-check.md): 支持对上游节点的主动和被动健康检查,在负载均衡时自动过滤掉不健康的节点。
|
||||
* [路由 radixtree](../router-radixtree.md)
|
||||
* [独立运行模型](stand-alone.md): 支持从本地 yaml 格式的配置文件启动,更适合 Kubernetes(k8s) 体系。
|
||||
* [TCP/UDP 动态代理](stream-proxy.md)
|
||||
* [gRPC 代理](grpc-proxy.md)
|
||||
* [自定义 Nginx 配置](./customize-nginx-configuration.md)
|
||||
* [变更日志](../../CHANGELOG_CN.md)
|
||||
* [压力测试](benchmark.md)
|
||||
* [代码风格](../../CODE_STYLE_CN.md)
|
||||
* [调试功能](./debug-function.md)
|
||||
* [常见问答](../../FAQ_CN.md)
|
||||
[![Build Status](https://github.com/apache/apisix/workflows/build/badge.svg?branch=master)](https://github.com/apache/apisix/actions)
|
||||
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/apache/apisix/blob/master/LICENSE)
|
||||
|
||||
## 插件
|
||||
**Apache APISIX** 是一个动态、实时、高性能的 API 网关,
|
||||
提供负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。
|
||||
|
||||
### General
|
||||
你可以使用 Apache APISIX 来处理传统的南北向流量,以及服务间的东西向流量,
|
||||
也可以当做 [k8s ingress controller](https://github.com/apache/apisix-ingress-controller) 来使用。
|
||||
|
||||
* [batch-requests](plugins/batch-requests.md): 以 **http pipeline** 的方式在网关一次性发起多个 `http` 请求。
|
||||
* [插件热加载](plugins.md):无需重启服务,完成插件热加载或卸载。
|
||||
* [HTTPS/TLS](https.md):根据 TLS 扩展字段 SNI(Server Name Indication) 动态加载证书。
|
||||
* [serverless](plugins/serverless.md):允许在 APISIX 中的不同阶段动态运行 Lua 代码。
|
||||
* [redirect](plugins/redirect.md): URI 重定向。
|
||||
Apache APISIX 的技术架构如下图所示:
|
||||
|
||||
### Transformation
|
||||
![](../../assets/images/apisix.png)
|
||||
|
||||
* [response-rewrite](plugins/response-rewrite.md): 支持自定义修改返回内容的 `status code`、`body`、`headers`。
|
||||
* [proxy-rewrite](plugins/proxy-rewrite.md): 支持自定义修改 proxy 到上游的信息。
|
||||
* [grpc-transcode](plugins/grpc-transcode.md):REST <--> gRPC 转码。
|
||||
* [fault-injection](plugins/fault-injection.md):故障注入,可以返回指定的响应体、响应码和响应时间,从而提供了不同的失败场景下处理的能力,例如服务失败、服务过载、服务高延时等。
|
||||
## 社区
|
||||
|
||||
### Authentication
|
||||
- 邮件列表 - 发送任意内容到 dev-subscribe@apisix.apache.org 后,根据回复以订阅邮件列表。
|
||||
- QQ 群 - 578997126
|
||||
- [Slack](http://s.apache.org/slack-invite) - 加入 `#apisix` 频道以便与成员交流。
|
||||
- ![Twitter Follow](https://img.shields.io/twitter/follow/ApacheAPISIX?style=social) - 使用标签 `#ApacheAPISIX` 关注我们并与我们互动。
|
||||
- [哔哩哔哩](https://space.bilibili.com/551921247)
|
||||
- **新手任务列表**
|
||||
- [Apache APISIX](https://github.com/apache/apisix/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX ingress controller](https://github.com/apache/apisix-ingress-controller/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX dashboard](https://github.com/apache/apisix-dashboard/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX Helm Chart](https://github.com/apache/apisix-helm-chart/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Docker distribution for APISIX](https://github.com/apache/apisix-docker/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [Apache APISIX Website](https://github.com/apache/apisix-website/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
- [The Control-Plane for APISIX](https://github.com/apache/apisix-control-plane/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
|
||||
|
||||
* [authz-keycloak](plugins/authz-keycloak.md): 支持 Keycloak 身份认证服务器
|
||||
* [wolf-rbac](plugins/wolf-rbac.md) 基于 *RBAC* 的用户认证及授权。
|
||||
* [key-auth](plugins/key-auth.md):基于 Key Authentication 的用户认证。
|
||||
* [JWT-auth](plugins/jwt-auth.md):基于 [JWT](https://jwt.io/) (JSON Web Tokens) Authentication 的用户认证。
|
||||
* [basic-auth](plugins/basic-auth.md):基于 basic auth 的用户认证。
|
||||
* [oauth](plugins/openid-connect.md): 提供 OAuth 2 身份验证和自省。
|
||||
* [openid-connect](plugins/openid-connect.md)
|
||||
## 特性
|
||||
|
||||
### Security
|
||||
你可以把 Apache APISIX 当做流量入口,来处理所有的业务数据,包括动态路由、动态上游、动态证书、
|
||||
A/B 测试、金丝雀发布(灰度发布)、蓝绿部署、限流限速、抵御恶意攻击、监控报警、服务可观测性、服务治理等。
|
||||
|
||||
* [cors](plugins/cors.md): 为你的API启用 CORS
|
||||
* [uri-blocker](plugins/uri-blocker.md): 根据 URI 拦截用户请求。
|
||||
- **全平台**
|
||||
|
||||
* [referer-restriction](plugins/referer-restriction.md): Referer 白名单。
|
||||
* [ip-restriction](plugins/ip-restriction.md): IP 黑白名单。
|
||||
- 云原生: 平台无关,没有供应商锁定,无论裸机还是 Kubernetes,APISIX 都可以运行。
|
||||
- 运行环境: OpenResty 和 Tengine 都支持。
|
||||
- 支持 ARM64: 不用担心底层技术的锁定。
|
||||
|
||||
### Traffic
|
||||
- **多协议**
|
||||
|
||||
* [limit-req](plugins/limit-req.md):基于漏桶原理的请求限速实现。
|
||||
* [limit-conn](plugins/limit-conn.md):限制并发请求(或并发连接)。
|
||||
* [limit-count](plugins/limit-count.md):基于“固定窗口”的限速实现。
|
||||
* [proxy-cache](plugins/proxy-cache.md):代理缓存插件提供缓存后端响应数据的能力。
|
||||
* [request-validation](plugins/request-validation.md): 请求验证。
|
||||
* [proxy-mirror](plugins/proxy-mirror.md):代理镜像插件提供镜像客户端请求的能力。
|
||||
* [api-breaker](plugins/api-breaker.md): API的断路器,在状态不正常的情况下停止将请求转发到上游。
|
||||
* [traffic-split](plugins/traffic-split.md):允许用户逐步控制各个上游之间的流量百分比。
|
||||
- [TCP/UDP 代理](stream-proxy.md): 动态 TCP/UDP 代理。
|
||||
- [Dubbo 代理](plugins/dubbo-proxy.md): 动态代理 HTTP 请求到 Dubbo 后端。
|
||||
- [动态 MQTT 代理](plugins/mqtt-proxy.md): 支持用 `client_id` 对 MQTT 进行负载均衡,同时支持 MQTT [3.1.\*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html) 和 [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html) 两个协议标准。
|
||||
- [gRPC 代理](grpc-proxy.md):通过 APISIX 代理 gRPC 连接,并使用 APISIX 的大部分特性管理你的 gRPC 服务。
|
||||
- [gRPC 协议转换](plugins/grpc-transcode.md):支持协议的转换,这样客户端可以通过 HTTP/JSON 来访问你的 gRPC API。
|
||||
- Websocket 代理
|
||||
- Proxy Protocol
|
||||
- Dubbo 代理:基于 Tengine,可以实现 Dubbo 请求的代理。
|
||||
- HTTP(S) 反向代理
|
||||
- [SSL](https.md):动态加载 SSL 证书。
|
||||
|
||||
### Monitoring
|
||||
- **全动态能力**
|
||||
|
||||
* [prometheus](plugins/prometheus.md):以 Prometheus 格式导出 APISIX 自身的状态信息,方便被外部 Prometheus 服务抓取。
|
||||
* [OpenTracing](plugins/zipkin.md):支持 Zikpin 和 Apache SkyWalking。
|
||||
* [Skywalking](plugins/skywalking.md): Supports Apache SkyWalking.
|
||||
- [热更新和热插件](plugins.md): 无需重启服务,就可以持续更新配置和插件。
|
||||
- [代理请求重写](plugins/proxy-rewrite.md): 支持重写请求上游的`host`、`uri`、`schema`、`enable_websocket`、`headers`信息。
|
||||
- [输出内容重写](plugins/response-rewrite.md): 支持自定义修改返回内容的 `status code`、`body`、`headers`。
|
||||
- [Serverless](plugins/serverless.md): 在 APISIX 的每一个阶段,你都可以添加并调用自己编写的函数。
|
||||
- 动态负载均衡:动态支持有权重的 round-robin 负载平衡。
|
||||
- 支持一致性 hash 的负载均衡:动态支持一致性 hash 的负载均衡。
|
||||
- [健康检查](health-check.md):启用上游节点的健康检查,将在负载均衡期间自动过滤不健康的节点,以确保系统稳定性。
|
||||
- 熔断器: 智能跟踪不健康上游服务。
|
||||
- [代理镜像](plugins/proxy-mirror.md): 提供镜像客户端请求的能力。
|
||||
- [流量拆分](plugins/traffic-split.md): 允许用户逐步控制各个上游之间的流量百分比。
|
||||
|
||||
### Loggers
|
||||
- **精细化路由**
|
||||
|
||||
* [http-logger](plugins/http-logger.md): 将请求记录到 HTTP 服务器。
|
||||
* [tcp-logger](plugins/tcp-logger.md): 将请求记录到 TCP 服务器。
|
||||
* [kafka-logger](plugins/kafka-logger.md): 将请求记录到外部 Kafka 服务器。
|
||||
* [udp-logger](plugins/udp-logger.md): 将请求记录到 UDP 服务器。
|
||||
* [sys-log](plugins/syslog.md): 将请求记录到 syslog 服务。
|
||||
* [log-rotate](plugins/log-rotate.md): 日志文件定期切分。
|
||||
- [支持全路径匹配和前缀匹配](router-radixtree.md#how-to-use-libradixtree-in-apisix)
|
||||
- [支持使用 Nginx 所有内置变量做为路由的条件](/router-radixtree.md#how-to-filter-route-by-nginx-builtin-variable),所以你可以使用 `cookie`, `args` 等做为路由的条件,来实现灰度发布、A/B 测试等功能
|
||||
- 支持[各类操作符做为路由的判断条件](https://github.com/iresty/lua-resty-radixtree#operator-list),比如 `{"arg_age", ">", 24}`
|
||||
- 支持[自定义路由匹配函数](https://github.com/iresty/lua-resty-radixtree/blob/master/t/filter-fun.t#L10)
|
||||
- IPv6:支持使用 IPv6 格式匹配路由
|
||||
- 支持路由的[自动过期(TTL)](admin-api.md#route)
|
||||
- [支持路由的优先级](router-radixtree.md#3-match-priority)
|
||||
- [支持批量 Http 请求](plugins/batch-requests.md)
|
||||
|
||||
## 部署
|
||||
- **安全防护**
|
||||
|
||||
### AWS
|
||||
- 多种身份认证方式: [key-auth](plugins/key-auth.md), [JWT](plugins/jwt-auth.md), [basic-auth](plugins/basic-auth.md), [wolf-rbac](plugins/wolf-rbac.md)。
|
||||
- [IP 黑白名单](plugins/ip-restriction.md)
|
||||
- [Referer 白名单](plugins/referer-restriction.md)
|
||||
- [IdP 支持](plugins/openid-connect.md): 支持外部的身份认证服务,比如 Auth0,Okta,Authing 等,用户可以借此来对接 Oauth2.0 等认证方式。
|
||||
- [限制速率](plugins/limit-req.md)
|
||||
- [限制请求数](plugins/limit-count.md)
|
||||
- [限制并发](plugins/limit-conn.md)
|
||||
- 防御 ReDoS(正则表达式拒绝服务):内置策略,无需配置即可抵御 ReDoS。
|
||||
- [CORS](plugins/cors.md):为你的 API 启用 CORS。
|
||||
- [URI 拦截器](plugins/uri-blocker.md):根据 URI 拦截用户请求。
|
||||
- [请求验证器](plugins/request-validation.md)。
|
||||
|
||||
推荐的方法是在 [AWS Fargate](https://aws.amazon.com/fargate/) 上使用 [AWS CDK](https://aws.amazon.com/cdk/) 部署 APISIX,这有助于将 APISIX 层和上游层分离到具有自动缩放功能的完全托管和安全的无服务器容器计算环境之上。
|
||||
- **运维友好**
|
||||
|
||||
### Kubernetes
|
||||
- OpenTracing 可观测性: 支持 [Apache Skywalking](plugins/skywalking.md) 和 [Zipkin](plugins/zipkin.md)。
|
||||
- 对接外部服务发现:除了内置的 etcd 外,还支持 `Consul` 和 `Nacos` 的 [DNS 发现模式](https://github.com/apache/apisix/issues/1731#issuecomment-646392129),以及 [Eureka](discovery.md)。
|
||||
- 监控和指标: [Prometheus](plugins/prometheus.md)
|
||||
- 集群:APISIX 节点是无状态的,创建配置中心集群请参考 [etcd Clustering Guide](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/clustering.md)。
|
||||
- 高可用:支持配置同一个集群内的多个 etcd 地址。
|
||||
- [控制台](https://github.com/apache/apisix-dashboard): 操作 APISIX 集群。
|
||||
- 版本控制:支持操作的多次回滚。
|
||||
- CLI: 使用命令行来启动、关闭和重启 APISIX。
|
||||
- [单机模式](stand-alone.md): 支持从本地配置文件中加载路由规则,在 kubernetes(k8s) 等环境下更友好。
|
||||
- [全局规则](architecture-design.md#global-rule):允许对所有请求执行插件,比如黑白名单、限流限速等。
|
||||
- 高性能:在单核上 QPS 可以达到 18k,同时延迟只有 0.2 毫秒。
|
||||
- [故障注入](plugins/fault-injection.md)
|
||||
- [REST Admin API](admin-api.md): 使用 REST Admin API 来控制 Apache APISIX,默认只允许 127.0.0.1 访问,你可以修改 `conf/config.yaml` 中的 `allow_admin` 字段,指定允许调用 Admin API 的 IP 列表。同时需要注意的是,Admin API 使用 key auth 来校验调用者身份,**在部署前需要修改 `conf/config.yaml` 中的 `admin_key` 字段,来保证安全。**
|
||||
- 外部日志记录器:将访问日志导出到外部日志管理工具。([HTTP Logger](plugins/http-logger.md), [TCP Logger](plugins/tcp-logger.md), [Kafka Logger](plugins/kafka-logger.md), [UDP Logger](plugins/udp-logger.md))
|
||||
- [Helm charts](https://github.com/apache/apisix-helm-chart)
|
||||
|
||||
请参阅[指南](../../kubernetes/README.md)并了解如何在 Kubernetes 中部署 APISIX。
|
||||
- **高度可扩展**
|
||||
- [自定义插件](plugin-develop.md): 允许挂载常见阶段,例如`init`, `rewrite`,`access`,`balancer`,`header filter`,`body filter` 和 `log` 阶段。
|
||||
- 自定义负载均衡算法:可以在 `balancer` 阶段使用自定义负载均衡算法。
|
||||
- 自定义路由: 支持用户自己实现路由算法。
|
||||
|
||||
## 立刻开始
|
||||
|
||||
### 编译和安装
|
||||
|
||||
APISIX 在以下操作系统中可顺利安装并做过测试:
|
||||
|
||||
CentOS 7, Ubuntu 16.04, Ubuntu 18.04, Debian 9, Debian 10, macOS, **ARM64** Ubuntu 18.04
|
||||
|
||||
有以下几种方式来安装 APISIX 的 Apache Release 版本:
|
||||
|
||||
1. 源码编译(适用所有系统)
|
||||
|
||||
- 安装运行时依赖:OpenResty 和 etcd,以及编译的依赖:luarocks。参考[依赖安装文档](install-dependencies.md)
|
||||
- 下载最新的源码发布包:
|
||||
|
||||
```shell
|
||||
$ mkdir apisix-2.3
|
||||
$ wget https://downloads.apache.org/apisix/2.3/apache-apisix-2.3-src.tgz
|
||||
$ tar zxvf apache-apisix-2.3-src.tgz -C apisix-2.3
|
||||
```
|
||||
|
||||
- 安装运行时依赖的 Lua 库:
|
||||
|
||||
```shell
|
||||
$ make deps
|
||||
```
|
||||
|
||||
- 检查 APISIX 的版本号:
|
||||
|
||||
```shell
|
||||
$ ./bin/apisix version
|
||||
```
|
||||
|
||||
- 启动 APISIX:
|
||||
|
||||
```shell
|
||||
$ ./bin/apisix start
|
||||
```
|
||||
|
||||
2. [Docker 镜像](https://hub.docker.com/r/apache/apisix)(适用所有系统)
|
||||
|
||||
默认会拉取最新的 Apache 发布包:
|
||||
|
||||
```shell
|
||||
$ docker pull apache/apisix
|
||||
```
|
||||
|
||||
Docker 镜像中并不包含 etcd,你可以参考 [docker compose 的示例](https://github.com/apache/apisix-docker/tree/master/example)来启动一个测试集群。
|
||||
|
||||
3. RPM 包(只适用于 CentOS 7)
|
||||
|
||||
- 安装依赖:OpenResty, etcd 和 OpenSSL develop library,参考[依赖安装文档](install-dependencies.md#centos-7)
|
||||
- 安装 APISIX:
|
||||
|
||||
```shell
|
||||
$ sudo yum install -y https://github.com/apache/apisix/releases/download/2.3/apisix-2.3-0.x86_64.rpm
|
||||
```
|
||||
|
||||
- 检查 APISIX 的版本号:
|
||||
|
||||
```shell
|
||||
$ apisix version
|
||||
```
|
||||
|
||||
- 启动 APISIX:
|
||||
|
||||
```shell
|
||||
$ apisix start
|
||||
```
|
||||
|
||||
**注意**:Apache APISIX 从 v2.0 开始不再支持 etcd v2 协议,并且 etcd 最低支持版本为 v3.4.0,如果有需要请进行升级。如果需要将数据迁移至 etcd v3,请按照 [etcd 迁移指南](https://etcd.io/docs/v3.4.0/op-guide/v2-migration/) 进行迁移。
|
||||
|
||||
### 针对开发者
|
||||
|
||||
1. 对于开发者而言,可以使用最新的 master 分支来体验更多功能
|
||||
|
||||
- 源码编译
|
||||
|
||||
```shell
|
||||
$ git clone git@github.com:apache/apisix.git
|
||||
$ cd apisix
|
||||
$ make deps
|
||||
```
|
||||
|
||||
- Docker 镜像
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/apache/apisix-docker.git
|
||||
$ cd apisix-docker
|
||||
$ sudo docker build -f alpine-dev/Dockerfile .
|
||||
```
|
||||
|
||||
2. 入门指南
|
||||
|
||||
入门指南是学习 APISIX 基础知识的好方法。按照 [入门指南](getting-started.md)的步骤即可。
|
||||
|
||||
更进一步,你可以跟着文档来尝试更多的[插件](README.md#插件)。
|
||||
|
||||
3. Admin API
|
||||
|
||||
Apache APISIX 提供了 [REST Admin API](admin-api.md),方便动态控制 Apache APISIX 集群。
|
||||
|
||||
4. 插件二次开发
|
||||
|
||||
可以参考[插件开发指南](plugin-develop.md),以及[示例插件 echo](plugins/echo.md) 的文档和代码实现。
|
||||
|
||||
请注意,Apache APISIX 的插件新增、更新、删除等都是热加载的,不用重启服务。
|
||||
|
||||
更多文档请参考 [Apache APISIX 文档索引](README.md)。
|
||||
|
||||
## 性能测试
|
||||
|
||||
使用 AWS 的 8 核心服务器来压测 APISIX,QPS 可以达到 140000,同时延时只有 0.2 毫秒。
|
||||
|
||||
[性能测试脚本](benchmark/run.sh),以及[测试方法和过程](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)已经开源,欢迎补充。
|
||||
|
||||
## Apache APISIX 和 Kong 的比较
|
||||
|
||||
#### API 网关核心功能点,两者均已覆盖
|
||||
|
||||
| **功能** | **Apache APISIX** | **KONG** |
|
||||
| :------------------- | :---------------- | :------- |
|
||||
| **动态上游** | 支持 | 支持 |
|
||||
| **动态路由** | 支持 | 支持 |
|
||||
| **健康检查和熔断器** | 支持 | 支持 |
|
||||
| **动态 SSL 证书** | 支持 | 支持 |
|
||||
| **七层和四层代理** | 支持 | 支持 |
|
||||
| **分布式追踪** | 支持 | 支持 |
|
||||
| **自定义插件** | 支持 | 支持 |
|
||||
| **REST API** | 支持 | 支持 |
|
||||
| **CLI** | 支持 | 支持 |
|
||||
|
||||
#### Apache APISIX 的优势
|
||||
|
||||
| **功能** | **Apache APISIX** | **KONG** |
|
||||
| :------------------------------------ | :-------------------------------------- | :--------------------- |
|
||||
| 项目归属 | Apache 软件基金会 | Kong Inc. |
|
||||
| 技术架构 | Nginx + etcd | Nginx + postgres |
|
||||
| 交流渠道 | 微信群、QQ 群、邮件列表、GitHub、meetup | GitHub、论坛、freenode |
|
||||
| 单核 QPS (开启限流和 prometheus 插件) | 18000 | 1700 |
|
||||
| 平均延迟 | 0.2 毫秒 | 2 毫秒 |
|
||||
| 支持 Dubbo 代理 | 是 | 否 |
|
||||
| 配置回滚 | 是 | 否 |
|
||||
| 支持生命周期的路由 | 是 | 否 |
|
||||
| 插件热更新 | 是 | 否 |
|
||||
| 用户自定义:负载均衡算法、路由 | 是 | 否 |
|
||||
| resty <--> gRPC 转码 | 是 | 否 |
|
||||
| 支持 Tengine 作为运行时 | 是 | 否 |
|
||||
| MQTT 协议支持 | 是 | 否 |
|
||||
| 配置生效时间 | 事件通知,低于 1 毫秒更新 | 定期轮询,5 秒 |
|
||||
| 自带控制台 | 是 | 否 |
|
||||
| 对接外部身份认证服务 | 是 | 否 |
|
||||
| 配置中心高可用(HA) | 是 | 否 |
|
||||
| 指定时间窗口的限速 | 是 | 否 |
|
||||
| 支持任何 Nginx 变量做路由条件 | 是 | 否 |
|
||||
|
||||
性能对比测试[详细内容如下](https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01)。
|
||||
|
||||
### 贡献者变化
|
||||
|
||||
![contributor-over-time](docs/assets/images/contributor-over-time.png)
|
||||
|
||||
## 视频和文章
|
||||
|
||||
- 2020.10.16 [Apache APISIX: How to implement plugin orchestration in API Gateway](https://www.youtube.com/watch?v=iEegNXOtEhQ)
|
||||
- 2020.10.16 [Improve Apache APISIX observability with Apache Skywalking](https://www.youtube.com/watch?v=DleVJwPs4i4)
|
||||
- 2020.1.17 [API 网关 Apache APISIX 和 Kong 的选型对比](https://mp.weixin.qq.com/s/c51apneVj0O9yxiZAHF34Q)
|
||||
- 2019.12.14 [从 0 到 1:Apache APISIX 的 Apache 之路](https://zhuanlan.zhihu.com/p/99620158)
|
||||
- 2019.12.14 [基于 Apache APISIX 的下一代微服务架构](https://www.upyun.com/opentalk/445.html)
|
||||
- 2019.10.30 [Apache APISIX 微服务架构极致性能架构解析](https://www.upyun.com/opentalk/440.html)
|
||||
- 2019.9.27 [想把 APISIX 运行在 ARM64 平台上?只要三步](https://zhuanlan.zhihu.com/p/84467919)
|
||||
- 2019.8.31 [APISIX 技术选型、测试和持续集成](https://www.upyun.com/opentalk/433.html)
|
||||
- 2019.8.31 [APISIX 高性能实战 2](https://www.upyun.com/opentalk/437.html)
|
||||
- 2019.7.6 [APISIX 高性能实战](https://www.upyun.com/opentalk/429.html)
|
||||
|
||||
## 用户实际使用案例
|
||||
|
||||
- [欧盟数字工厂平台: API Security Gateway – Using APISIX in the eFactory Platform](https://www.efactory-project.eu/post/api-security-gateway-using-apisix-in-the-efactory-platform)
|
||||
- [贝壳找房:如何基于 Apache APISIX 搭建网关](https://mp.weixin.qq.com/s/yZl9MWPyF1-gOyCp8plflA)
|
||||
- [360:Apache APISIX 在基础运维平台项目中的实践](https://mp.weixin.qq.com/s/zHF_vlMaPOSoiNvqw60tVw)
|
||||
- [HelloTalk:基于 OpenResty 和 Apache APISIX 的全球化探索之路](https://www.upyun.com/opentalk/447.html)
|
||||
- [腾讯云:为什么选择 Apache APISIX 来实现 k8s ingress controller?](https://www.upyun.com/opentalk/448.html)
|
||||
- [思必驰:为什么我们重新写了一个 k8s ingress controller?](https://mp.weixin.qq.com/s/bmm2ibk2V7-XYneLo9XAPQ)
|
||||
|
||||
## APISIX 的用户有哪些?
|
||||
|
||||
有很多公司和组织把 APISIX 用于学习、研究、生产环境和商业产品中,包括:
|
||||
|
||||
<img src="https://raw.githubusercontent.com/api7/website-of-API7/master/user-wall.jpg" width="900" height="500" />
|
||||
|
||||
欢迎用户把自己加入到 [Powered By](powered-by.md) 页面。
|
||||
|
||||
## 全景图
|
||||
|
||||
<p align="left">
|
||||
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150" /> <img src="https://landscape.cncf.io/images/right-logo.svg" width="200" />
|
||||
<br /><br />
|
||||
APISIX 被纳入 <a href="https://landscape.cncf.io/card-mode?category=api-gateway&grouping=category"> 云原生软件基金会 API 网关全景图</a>
|
||||
</p>
|
||||
|
||||
## Logo
|
||||
|
||||
- [Apache APISIX logo(PNG)](logos/apache-apisix.png)
|
||||
- [Apache APISIX logo 源文件](https://apache.org/logos/#apisix)
|
||||
|
||||
## 贡献
|
||||
|
||||
我们欢迎来自开源社区、个人和合作伙伴的各种贡献。
|
||||
|
||||
- [贡献指南](../../../CONTRIBUTING.md)
|
||||
|
||||
## 致谢
|
||||
|
||||
灵感来自 Kong 和 Orange。
|
||||
|
||||
## 协议
|
||||
|
||||
[Apache 2.0 License](LICENSE)
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 基准测试
|
||||
title: 压力测试
|
||||
---
|
||||
|
||||
<!--
|
||||
|
@ -1,4 +1,151 @@
|
||||
{
|
||||
"version": 2.3,
|
||||
"sidebar": {}
|
||||
"sidebar": [
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "architecture-design"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "how-to-build"
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Plugins",
|
||||
"items": [
|
||||
{
|
||||
"type": "category",
|
||||
"label": "General",
|
||||
"items": [
|
||||
"plugins/batch-requests",
|
||||
"plugins/serverless",
|
||||
"plugins/redirect"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Transformation",
|
||||
"items": [
|
||||
"plugins/response-rewrite",
|
||||
"plugins/proxy-rewrite",
|
||||
"plugins/grpc-transcode",
|
||||
"plugins/fault-injection"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Authentication",
|
||||
"items": [
|
||||
"plugins/authz-keycloak",
|
||||
"plugins/wolf-rbac",
|
||||
"plugins/key-auth",
|
||||
"plugins/jwt-auth",
|
||||
"plugins/basic-auth",
|
||||
"plugins/openid-connect"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Security",
|
||||
"items": [
|
||||
"plugins/cors",
|
||||
"plugins/uri-blocker",
|
||||
"plugins/ip-restriction",
|
||||
"plugins/referer-restriction"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Traffic",
|
||||
"items": [
|
||||
"plugins/limit-req",
|
||||
"plugins/limit-conn",
|
||||
"plugins/limit-count",
|
||||
"plugins/proxy-cache",
|
||||
"plugins/request-validation",
|
||||
"plugins/proxy-mirror",
|
||||
"plugins/api-breaker",
|
||||
"plugins/traffic-split"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Monitoring",
|
||||
"items": [
|
||||
"plugins/prometheus",
|
||||
"plugins/zipkin",
|
||||
"plugins/skywalking"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Loggers",
|
||||
"items": [
|
||||
"plugins/http-logger",
|
||||
"plugins/tcp-logger",
|
||||
"plugins/kafka-logger",
|
||||
"plugins/udp-logger",
|
||||
"plugins/syslog",
|
||||
"plugins/log-rotate"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "admin-api"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "control-api"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "health-check"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "router-radixtree"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "stand-alone"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "stream-proxy"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "grpc-proxy"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "customize-nginx-configuration"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "https"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "benchmark"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "CODE_STYLE"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "debug-function"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "FAQ"
|
||||
},
|
||||
{
|
||||
"type": "doc",
|
||||
"id": "CHANGELOG"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: grpc-proxy
|
||||
title: gRPC 代理
|
||||
---
|
||||
|
||||
<!--
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 构建 Apache APISIX
|
||||
title: 如何构建 Apache APISIX
|
||||
---
|
||||
|
||||
<!--
|
||||
|
@ -25,13 +25,13 @@ title: limit-conn
|
||||
|
||||
### 属性
|
||||
|
||||
| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
|
||||
| ------------------ | ------- | -------- | ------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| conn | integer | required | | conn > 0 | 允许的最大并发请求数。超过 `conn` 的限制、但是低于 `conn` + `burst` 的请求,将被延迟处理。 |
|
||||
| burst | integer | required | | burst >= 0 | 允许被延迟处理的并发请求数。 |
|
||||
| default_conn_delay | number | required | | default_conn_delay > 0 | 默认的典型连接(或请求)的处理延迟时间。 |
|
||||
| key | object | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | 用户指定的限制并发级别的关键字,可以是客户端IP或服务端IP。<br>例如,可以使用主机名(或服务器区域)作为关键字,以便限制每个主机名的并发性。 否则,我们也可以使用客户端地址作为关键字,这样我们就可以避免单个客户端用太多的并行连接或请求淹没我们的服务。 <br>当前接受的 key 有:"remote_addr"(客户端IP地址), "server_addr"(服务端 IP 地址), 请求头中的"X-Forwarded-For" 或 "X-Real-IP", "consumer_name"(consumer 的 username)。 |
|
||||
| rejected_code | string | optional | 503 | [200,...,599] | 当请求超过 `conn` + `burst` 这个阈值时,返回的 HTTP状态码 |
|
||||
| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
|
||||
| ------------------ | ------- | -------- | ------ | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| conn | integer | required | | conn > 0 | 允许的最大并发请求数。超过 `conn` 的限制、但是低于 `conn` + `burst` 的请求,将被延迟处理。 |
|
||||
| burst | integer | required | | burst >= 0 | 允许被延迟处理的并发请求数。 |
|
||||
| default_conn_delay | number | required | | default_conn_delay > 0 | 默认的典型连接(或请求)的处理延迟时间。 |
|
||||
| key | object | required | | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name"] | 用户指定的限制并发级别的关键字,可以是客户端 IP 或服务端 IP。<br />例如,可以使用主机名(或服务器区域)作为关键字,以便限制每个主机名的并发性。 否则,我们也可以使用客户端地址作为关键字,这样我们就可以避免单个客户端用太多的并行连接或请求淹没我们的服务。 <br />当前接受的 key 有:"remote_addr"(客户端 IP 地址), "server_addr"(服务端 IP 地址), 请求头中的"X-Forwarded-For" 或 "X-Real-IP", "consumer_name"(consumer 的 username)。 |
|
||||
| rejected_code | string | optional | 503 | [200,...,599] | 当请求超过 `conn` + `burst` 这个阈值时,返回的 HTTP 状态码 |
|
||||
|
||||
**注:key 是可以被用户自定义的,只需要修改插件的一行代码即可完成。并没有在插件中放开是处于安全的考虑。**
|
||||
|
||||
|
@ -23,11 +23,11 @@ title: limit-count
|
||||
|
||||
## 目录
|
||||
|
||||
- [简介](#简介)
|
||||
- [参数](#参数)
|
||||
- [如何使用](#如何使用)
|
||||
- [测试插件](#测试插件)
|
||||
- [移除插件](#移除插件)
|
||||
- [简介](#简介)
|
||||
- [参数](#参数)
|
||||
- [如何使用](#如何使用)
|
||||
- [测试插件](#测试插件)
|
||||
- [移除插件](#移除插件)
|
||||
|
||||
## 简介
|
||||
|
||||
@ -36,19 +36,19 @@ title: limit-count
|
||||
|
||||
## 参数
|
||||
|
||||
| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
|
||||
| --------------- | -------- | ------------ | ------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| count | integer | 必须 | | count > 0 | 指定时间窗口内的请求数量阈值 |
|
||||
| time_window | integer | 必须 | | time_window > 0 | 时间窗口的大小(以秒为单位),超过这个时间就会重置 |
|
||||
| key | string | 可选 | "remote_addr" | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name", "service_id"] | 用来做请求计数的有效值。<br>例如,可以使用主机名(或服务器区域)作为关键字,以便限制每个主机名规定时间内的请求次数。我们也可以使用客户端地址作为关键字,这样我们就可以避免单个客户端规定时间内多次的连接我们的服务。<br>当前接受的 key 有:"remote_addr"(客户端IP地址), "server_addr"(服务端 IP 地址), 请求头中的"X-Forwarded-For" 或 "X-Real-IP", "consumer_name"(consumer 的 username), "service_id" 。 |
|
||||
| rejected_code | integer | 可选 | 503 | [200,...,599] | 当请求超过阈值被拒绝时,返回的 HTTP 状态码 |
|
||||
| policy | string | 可选 | "local" | ["local", "redis", "redis-cluster"] | 用于检索和增加限制的速率限制策略。可选的值有:`local`(计数器被以内存方式保存在节点本地,默认选项) 和 `redis`(计数器保存在 Redis 服务节点上,从而可以跨节点共享结果,通常用它来完成全局限速);以及`redis-cluster`,跟redis功能一样,只是使用redis集群方式。 |
|
||||
| redis_host | string | `redis` 必须 | | | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的地址。 |
|
||||
| redis_port | integer | 可选 | 6379 | [1,...] | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的端口 |
|
||||
| redis_password | string | 可选 | | | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的密码。 |
|
||||
| redis_database | integer | 可选 | 0 | redis_database >= 0 | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点中使用的 database,并且只针对非 Redis 集群模式(单实例模式或者提供单入口的Redis公有云服务)生效。 |
|
||||
| redis_timeout | integer | 可选 | 1000 | [1,...] | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点以毫秒为单位的超时时间 |
|
||||
| redis_cluster_nodes | array | 可选 | | | 当使用 `redis-cluster` 限速策略时,该属性是 Redis 集群服务节点的地址列表。 |
|
||||
| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 |
|
||||
| ------------------- | ------- | ------------ | ------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| count | integer | 必须 | | count > 0 | 指定时间窗口内的请求数量阈值 |
|
||||
| time_window | integer | 必须 | | time_window > 0 | 时间窗口的大小(以秒为单位),超过这个时间就会重置 |
|
||||
| key | string | 可选 | "remote_addr" | ["remote_addr", "server_addr", "http_x_real_ip", "http_x_forwarded_for", "consumer_name", "service_id"] | 用来做请求计数的有效值。<br />例如,可以使用主机名(或服务器区域)作为关键字,以便限制每个主机名规定时间内的请求次数。我们也可以使用客户端地址作为关键字,这样我们就可以避免单个客户端规定时间内多次的连接我们的服务。<br />当前接受的 key 有:"remote_addr"(客户端 IP 地址), "server_addr"(服务端 IP 地址), 请求头中的"X-Forwarded-For" 或 "X-Real-IP", "consumer_name"(consumer 的 username), "service_id" 。 |
|
||||
| rejected_code | integer | 可选 | 503 | [200,...,599] | 当请求超过阈值被拒绝时,返回的 HTTP 状态码 |
|
||||
| policy | string | 可选 | "local" | ["local", "redis", "redis-cluster"] | 用于检索和增加限制的速率限制策略。可选的值有:`local`(计数器被以内存方式保存在节点本地,默认选项) 和 `redis`(计数器保存在 Redis 服务节点上,从而可以跨节点共享结果,通常用它来完成全局限速);以及`redis-cluster`,跟 redis 功能一样,只是使用 redis 集群方式。 |
|
||||
| redis_host | string | `redis` 必须 | | | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的地址。 |
|
||||
| redis_port | integer | 可选 | 6379 | [1,...] | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的端口 |
|
||||
| redis_password | string | 可选 | | | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的密码。 |
|
||||
| redis_database | integer | 可选 | 0 | redis_database >= 0 | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点中使用的 database,并且只针对非 Redis 集群模式(单实例模式或者提供单入口的 Redis 公有云服务)生效。 |
|
||||
| redis_timeout | integer | 可选 | 1000 | [1,...] | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点以毫秒为单位的超时时间 |
|
||||
| redis_cluster_nodes | array | 可选 | | | 当使用 `redis-cluster` 限速策略时,该属性是 Redis 集群服务节点的地址列表。 |
|
||||
|
||||
**key 是可以被用户自定义的,只需要修改插件的一行代码即可完成。并没有在插件中放开是处于安全的考虑。**
|
||||
|
||||
|
@ -108,7 +108,7 @@ plugin_attr:
|
||||
|
||||
插件导出的指标可以在 Grafana 进行图形化绘制显示。
|
||||
|
||||
下载 [Grafana dashboard 元数据](../../json/apisix-grafana-dashboard.json) 并导入到 Grafana 中。
|
||||
下载 [Grafana dashboard 元数据](../../../assets/other/json/apisix-grafana-dashboard.json) 并导入到 Grafana 中。
|
||||
|
||||
你可以到 [Grafana 官方](https://grafana.com/grafana/dashboards/11719) 下载 `Grafana` 元数据.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Stream 代理
|
||||
title: TCP/UDP 动态代理
|
||||
---
|
||||
|
||||
<!--
|
||||
|
Loading…
Reference in New Issue
Block a user