mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-02 03:58:02 +08:00
chore: spelling (#3012)
Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com> Co-authored-by: YuanSheng Wang <membphis@gmail.com>
This commit is contained in:
parent
b7325f033e
commit
3c01db5ef0
@ -477,7 +477,7 @@ end
|
||||
|
||||
function _M.getkey(self, key)
|
||||
if not self.running then
|
||||
return nil, "stoped"
|
||||
return nil, "stopped"
|
||||
end
|
||||
|
||||
return getkey(self.etcd_cli, key)
|
||||
|
@ -189,7 +189,7 @@ local function sync_data(self)
|
||||
data_valid = false
|
||||
log.error("invalid item data of [", self.key .. "/" .. id,
|
||||
"], val: ", json.delay_encode(item),
|
||||
", it shoud be a object")
|
||||
", it should be a object")
|
||||
end
|
||||
|
||||
local key = item.id or "arr_" .. i
|
||||
|
@ -135,7 +135,7 @@ end
|
||||
|
||||
|
||||
function _M.get_upstream_status(ctx)
|
||||
-- $upstream_status maybe including mutiple status, only need the last one
|
||||
-- $upstream_status maybe including multiple status, only need the last one
|
||||
return tonumber(str_sub(ctx.var.upstream_status or "", -3))
|
||||
end
|
||||
|
||||
|
@ -224,7 +224,7 @@ function _M.log(conf, ctx)
|
||||
-- clear related status
|
||||
if healthy_count >= conf.healthy.successes then
|
||||
-- stat change to normal
|
||||
core.log.info("chagne to normal, ", healthy_key, " ", healthy_count)
|
||||
core.log.info("change to normal, ", healthy_key, " ", healthy_count)
|
||||
shared_buffer:delete(gen_lasttime_key(ctx))
|
||||
shared_buffer:delete(unhealthy_key)
|
||||
shared_buffer:delete(healthy_key)
|
||||
|
@ -69,7 +69,7 @@ local schema = {
|
||||
},
|
||||
allow_credential = {
|
||||
description =
|
||||
"allow client append crendential. according to CORS specification," ..
|
||||
"allow client append credential. according to CORS specification," ..
|
||||
"if you set this option to 'true', you can not use '*' for other options.",
|
||||
type = "boolean",
|
||||
default = false
|
||||
@ -85,7 +85,7 @@ local _M = {
|
||||
}
|
||||
|
||||
|
||||
local function create_mutiple_origin_cache(conf)
|
||||
local function create_multiple_origin_cache(conf)
|
||||
if not str_find(conf.allow_origins, ",") then
|
||||
return nil
|
||||
end
|
||||
@ -166,9 +166,9 @@ function _M.header_filter(conf, ctx)
|
||||
allow_origins = req_origin or '*'
|
||||
end
|
||||
local multiple_origin, err = core.lrucache.plugin_ctx(lrucache, ctx, nil,
|
||||
create_mutiple_origin_cache, conf)
|
||||
create_multiple_origin_cache, conf)
|
||||
if err then
|
||||
return 500, {message = "get mutiple origin cache failed: " .. err}
|
||||
return 500, {message = "get multiple origin cache failed: " .. err}
|
||||
end
|
||||
|
||||
if multiple_origin then
|
||||
|
@ -69,7 +69,7 @@ function _M.init()
|
||||
|
||||
clear_tab(metrics)
|
||||
|
||||
-- Newly added metrics should follow the naming best pratices described in
|
||||
-- Newly added metrics should follow the naming best practices described in
|
||||
-- https://prometheus.io/docs/practices/naming/#metric-names
|
||||
-- For example,
|
||||
-- 1. Add unit as the suffix
|
||||
|
@ -169,7 +169,7 @@ end
|
||||
function batch_processor:process_buffer()
|
||||
-- If entries are present in the buffer move the entries to processing
|
||||
if #self.entry_buffer.entries > 0 then
|
||||
core.log.debug("tranferring buffer entries to processing pipe line, ",
|
||||
core.log.debug("transferring buffer entries to processing pipe line, ",
|
||||
"buffercount[", #self.entry_buffer.entries ,"]")
|
||||
self.batch_to_process[#self.batch_to_process + 1] = self.entry_buffer
|
||||
self.entry_buffer = { entries = {}, retry_count = 0 }
|
||||
|
@ -115,13 +115,13 @@ apisix:
|
||||
# If set this, must be a string of length 16. And it will encrypt ssl key with AES-128-CBC
|
||||
# !!! So do not change it after saving your ssl, it can't decrypt the ssl keys have be saved if you change !!
|
||||
|
||||
nginx_config: # config for render the template to genarate nginx.conf
|
||||
nginx_config: # config for render the template to generate nginx.conf
|
||||
error_log: "logs/error.log"
|
||||
error_log_level: "warn" # warn,error
|
||||
worker_processes: auto # one worker will get best performance, you can use "auto", but remember it is just work well only on physical machine
|
||||
# no more than 8 workers, otherwise competition between workers will consume a lot of resources
|
||||
# if you want use multiple cores in container, you can inject the number of cpu as environment variable "APISIX_WORKER_PROCESSES"
|
||||
enable_cpu_affinity: true # enbale cpu affinity, this is just work well only on physical machine
|
||||
enable_cpu_affinity: true # enable cpu affinity, this is just work well only on physical machine
|
||||
worker_rlimit_nofile: 20480 # the number of files a worker process can open, should be larger than worker_connections
|
||||
worker_shutdown_timeout: 240s # timeout for a graceful shutdown of worker processes
|
||||
event:
|
||||
@ -195,7 +195,7 @@ etcd:
|
||||
# read: 5000 # default 5000ms
|
||||
|
||||
graphql:
|
||||
max_size: 1048576 # the maximum size limitation of graphql in bytes, defualt 1MiB
|
||||
max_size: 1048576 # the maximum size limitation of graphql in bytes, default 1MiB
|
||||
|
||||
plugins: # plugin list (sorted in alphabetical order)
|
||||
- api-breaker
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
### General
|
||||
|
||||
* [batch-requests](plugins/batch-requests.md): Allow you send mutiple http api via **http pipeline**.
|
||||
* [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.
|
||||
@ -74,7 +74,7 @@
|
||||
### Traffic
|
||||
|
||||
* [limit-req](plugins/limit-req.md): Request rate limiting and adjustment based on the "leaky bucket" method.
|
||||
* [limit-conn](plugins/limit-conn.md): Limite request concurrency (or concurrent connections).
|
||||
* [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.
|
||||
|
@ -208,7 +208,7 @@ Name: apiSi-PhpSe-FOL2MM4TW7G8-09029e095ab36fcc.elb.us-west-2.amazonaws.com
|
||||
Address: 44.226.102.63
|
||||
```
|
||||
|
||||
Configure the IP addresses returned as your upstream nodes in your **APISIX** dashboard followed by the **Services** and **Routes** configuration. Let's say we have a `/index.php` as the URI for the first route for our first **Service** from the **Upstream** IP adddresses.
|
||||
Configure the IP addresses returned as your upstream nodes in your **APISIX** dashboard followed by the **Services** and **Routes** configuration. Let's say we have a `/index.php` as the URI for the first route for our first **Service** from the **Upstream** IP addresses.
|
||||
|
||||
|
||||
![](images/aws-nlb-ip-addr.png)
|
||||
|
@ -171,8 +171,8 @@ Add following configuration in `conf/config.yaml` :
|
||||
discovery:
|
||||
eureka:
|
||||
host: # it's possible to define multiple eureka hosts addresses of the same eureka cluster.
|
||||
- "http://${usename}:${passowrd}@${eureka_host1}:${eureka_port1}"
|
||||
- "http://${usename}:${passowrd}@${eureka_host2}:${eureka_port2}"
|
||||
- "http://${username}:${password}@${eureka_host1}:${eureka_port1}"
|
||||
- "http://${username}:${password}@${eureka_host2}:${eureka_port2}"
|
||||
prefix: "/eureka/"
|
||||
fetch_interval: 30 # 30s
|
||||
weight: 100 # default weight for node
|
||||
|
@ -131,7 +131,7 @@ make sure to set openresty as default nginx. And export the path as below.
|
||||
* export PATH=/usr/local/opt/openresty/nginx/sbin:$PATH
|
||||
|
||||
**Run Individual Test Cases**
|
||||
- Use the following command to run test cases constratined to a file:
|
||||
- Use the following command to run test cases constrained to a file:
|
||||
- prove -Itest-nginx/lib -r t/plugin/openid-connect.t
|
||||
|
||||
## 5. Update Admin API token to protect Apache APISIX
|
||||
|
@ -30,7 +30,7 @@ Note
|
||||
====
|
||||
- Since v2.0 Apache APISIX would not support the v2 protocol storage to etcd anymore, and the minimum etcd version supported is v3.4.0. What's more, etcd v3 uses gRPC as the messaging protocol, while Apache APISIX uses HTTP(S) to communicate with etcd cluster, so be sure the [etcd gRPC gateway](https://etcd.io/docs/v3.4.0/dev-guide/api_grpc_gateway/) is enabled.
|
||||
|
||||
- Now by default Apache APISIX uses HTTP protocol to talk with etcd cluster, which is insecure. Please configure certificate and correspsonding private key for your etcd cluster, and use "https" scheme explicitly in the etcd endpoints list in your Apache APISIX configuration, if you want to keep the data secure and integral. See the etcd section in `conf/config-default.yaml` for more details.
|
||||
- Now by default Apache APISIX uses HTTP protocol to talk with etcd cluster, which is insecure. Please configure certificate and corresponding private key for your etcd cluster, and use "https" scheme explicitly in the etcd endpoints list in your Apache APISIX configuration, if you want to keep the data secure and integral. See the etcd section in `conf/config-default.yaml` for more details.
|
||||
|
||||
- If you want use Tengine instead of OpenResty, please take a look at this installation step script [Install Tengine at Ubuntu](../.travis/linux_tengine_runner.sh).
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
## Name
|
||||
|
||||
`authz-keycloak` is an authorization plugin to be used with the Keycloak Identity Server. Keycloak is an OAuth/OIDC and
|
||||
UMA compliant Ideneity Server. Although, its developed to working in conjunction with Keycloak it should work with any
|
||||
UMA compliant Identity Server. Although, its developed to working in conjunction with Keycloak it should work with any
|
||||
OAuth/OIDC and UMA compliant identity providers as well.
|
||||
|
||||
For more information on Keycloak, refer to [Keycloak Authorization Docs](https://www.keycloak.org/docs/latest/authorization_services) for more information.
|
||||
|
@ -53,7 +53,7 @@ Default enabled
|
||||
|
||||
## How To Configure
|
||||
|
||||
By default, the maximun body size sent to the `/apisix/batch-requests` can't be larger than 1 MiB.
|
||||
By default, the maximum body size sent to the `/apisix/batch-requests` can't be larger than 1 MiB.
|
||||
You can configure it via `apisix/admin/plugin_metadata/batch-requests`:
|
||||
|
||||
```shell
|
||||
@ -67,7 +67,7 @@ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/batch-requests -H 'X-API
|
||||
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| ---------------- | ------- | ------ | ------------- | ------- | ------------------------------------------------ |
|
||||
| max_body_size | integer | required | 1048576 | > 0 | the maximun of request body size in bytes |
|
||||
| max_body_size | integer | required | 1048576 | > 0 | the maximum of request body size in bytes |
|
||||
|
||||
|
||||
## Batch API Request/Response
|
||||
|
@ -28,7 +28,7 @@ Fault injection plugin, this plugin can be used with other plugins and will be e
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| ----------------- | ------- | ----------- | ------- | ---------- | ------------------------------------------------ |
|
||||
| abort.http_status | integer | required | | [200, ...] | user-specified http code returned to the client. |
|
||||
| abort.body | string | optional | | | response data returned to the client. Nginx varialbe can be used inside, like `client addr: $remote_addr\n` |
|
||||
| abort.body | string | optional | | | response data returned to the client. Nginx variable can be used inside, like `client addr: $remote_addr\n` |
|
||||
| abort.percentage | integer | optional | | [0, 100] | percentage of requests to be aborted. |
|
||||
| delay.duration | number | required | | | delay time (can be decimal). |
|
||||
| delay.percentage | integer | optional | | [0, 100] | percentage of requests to be delayed. |
|
||||
|
@ -179,7 +179,7 @@ Trailer: grpc-message
|
||||
{"workflowKey":"#2251799813685260","workflowInstanceKey":"#2251799813688013","bpmnProcessId":"order-process","version":1}
|
||||
```
|
||||
|
||||
`"workflowKey":"#2251799813685260"` suggests pb_option configuation success.
|
||||
`"workflowKey":"#2251799813685260"` suggests pb_option configuration success.
|
||||
|
||||
## Disable Plugin
|
||||
|
||||
|
@ -48,7 +48,7 @@ For more info on Batch-Processor in Apache APISIX please refer.
|
||||
| key | string | optional | | | Used for partition allocation of messages. |
|
||||
| timeout | integer | optional | 3 | [1,...] | Timeout for the upstream to send data. |
|
||||
| name | string | optional | "kafka logger" | | A unique identifier to identity the batch processor. |
|
||||
| meta_format | enum | optional | "default" | ["default","origin"] | `default`: collect the request information with detfault JSON way. `origin`: collect the request information with original HTTP request. [example](#examples-of-meta_format)|
|
||||
| meta_format | enum | optional | "default" | ["default","origin"] | `default`: collect the request information with default JSON way. `origin`: collect the request information with original HTTP request. [example](#examples-of-meta_format)|
|
||||
| batch_max_size | integer | optional | 1000 | [1,...] | Set the maximum number of logs sent in each batch. When the number of logs reaches the set maximum, all logs will be automatically pushed to the `Kafka` service. |
|
||||
| inactive_timeout | integer | optional | 5 | [1,...] | The maximum time to refresh the buffer (in seconds). When the maximum refresh time is reached, all logs will be automatically pushed to the `Kafka` service regardless of whether the number of logs in the buffer reaches the set maximum number. |
|
||||
| buffer_duration | integer | optional | 60 | [1,...] | Maximum age in seconds of the oldest entry in a batch before the batch must be processed.|
|
||||
|
@ -38,7 +38,7 @@ And this plugin both support MQTT protocol [3.1.*](http://docs.oasis-open.org/mq
|
||||
|
||||
| Name | Type | Requirement | Default | Valid | Description |
|
||||
| -------------- | ------- | ----------- | ------- | ----- | -------------------------------------------------------------------------------------- |
|
||||
| protocol_name | string | required | | | Name of protocol, shoulds be `MQTT` in normal. |
|
||||
| protocol_name | string | required | | | Name of protocol, should be `MQTT` in normal. |
|
||||
| protocol_level | integer | required | | | Level of protocol, it should be `4` for MQTT `3.1.*`. it should be `5` for MQTT `5.0`. |
|
||||
| upstream.ip | string | required | | | IP address of upstream, will forward current request to. |
|
||||
| upstream.port | number | required | | | Port of upstream, will forward current request to. |
|
||||
|
@ -30,7 +30,7 @@
|
||||
## Name
|
||||
|
||||
The `referer-restriction` can restrict access to a Service or a Route by
|
||||
whitelisting request header Referers.
|
||||
whitelisting request header Referrers.
|
||||
|
||||
## Attributes
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
response rewrite plugin, rewrite the content returned by the upstream as well as Apache APISIX itself.
|
||||
|
||||
**senario**:
|
||||
**scenario**:
|
||||
|
||||
1. can set `Access-Control-Allow-*` series field to support CORS(Cross-origin Resource Sharing).
|
||||
2. we can set customized `status_code` and `Location` field in header to achieve redirect, you can also use [redirect](redirect.md) plugin if you just want a redirection.
|
||||
|
@ -193,7 +193,7 @@ $ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -H 'X-API-KEY: edd1c9f0343
|
||||
|
||||
The skywalking plugin has been disabled now. It works for other plugins.
|
||||
|
||||
If you want to disable skywalking plugin totally, for example, stop the background repor timer,
|
||||
If you want to disable skywalking plugin totally, for example, stop the background report timer,
|
||||
you need to comment out in the `config.yaml`:
|
||||
|
||||
```yaml
|
||||
|
@ -43,8 +43,8 @@ For more info on Batch-Processor in Apache APISIX please refer
|
||||
|host |required | IP address or the Hostname of the TCP server, please reference ali cloud log [Serve List](https://help.aliyun.com/document_detail/29008.html?spm=a2c4g.11186623.2.14.49301b4793uX0z#reference-wgx-pwq-zdb), use IP address insted of domain.|
|
||||
|port |required |Target upstream port, default 10009.|
|
||||
|timeout |optional |Timeout for the upstream to send data.|
|
||||
| project |required|Ali cloud log service project name,please creat in sls before us this plugin.|
|
||||
| logstore | required |Ali cloud log service logstore name,please creat in sls before us this plugin.|
|
||||
| project |required|Ali cloud log service project name,please create in sls before us this plugin.|
|
||||
| logstore | required |Ali cloud log service logstore name,please create in sls before us this plugin.|
|
||||
| access_key_id | required | Ali cloud AccessKey ID, reference [Authorization](https://help.aliyun.com/document_detail/47664.html?spm=a2c4g.11186623.2.15.49301b47lfvxXP#task-xsk-ttc-ry).|
|
||||
| access_key_secret | required |Ali cloud AccessKey Secret, reference [Authorization](https://help.aliyun.com/document_detail/47664.html?spm=a2c4g.11186623.2.15.49301b47lfvxXP#task-xsk-ttc-ry).|
|
||||
| include_req_body | required| Boolean value. |
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
This will provide the ability to send Log data requests as JSON objects to Monitoring tools and other TCP servers.
|
||||
|
||||
This plugin provides the ability to push Log data as a batch to you're external TCP servers. In case if you did not receive the log data don't worry give it some time it will automatically send the logs after the timer function expires in our Batch Processor.
|
||||
This plugin provides the ability to push Log data as a batch to your external TCP servers. In case if you did not receive the log data don't worry give it some time it will automatically send the logs after the timer function expires in our Batch Processor.
|
||||
|
||||
For more info on Batch-Processor in Apache APISIX please refer.
|
||||
[Batch-Processor](../batch-processor.md)
|
||||
|
@ -40,7 +40,7 @@ It's also works with `Apache SkyWalking`, which is support Zipkin v1/v2 format.
|
||||
| endpoint | string | required | | | the http endpoint of Ziplin, for example: `http://127.0.0.1:9411/api/v2/spans`. |
|
||||
| sample_ratio | number | required | | [0.00001, 1] | the ratio of sample |
|
||||
| service_name | string | optional | "APISIX" | | service name for zipkin reporter |
|
||||
| server_addr | string | optional | | | IPv4 address for zipkin reporter, default is nginx built-in variables $server_addr, here you can speific your external ip address. |
|
||||
| server_addr | string | optional | | | IPv4 address for zipkin reporter, default is nginx built-in variables $server_addr, here you can specify your external ip address. |
|
||||
|
||||
## How To Enable
|
||||
|
||||
|
@ -169,8 +169,8 @@ discovery:
|
||||
discovery:
|
||||
eureka:
|
||||
host: # it's possible to define multiple eureka hosts addresses of the same eureka cluster.
|
||||
- "http://${usename}:${passowrd}@${eureka_host1}:${eureka_port1}"
|
||||
- "http://${usename}:${passowrd}@${eureka_host2}:${eureka_port2}"
|
||||
- "http://${username}:${password}@${eureka_host1}:${eureka_port1}"
|
||||
- "http://${username}:${password}@${eureka_host2}:${eureka_port2}"
|
||||
prefix: "/eureka/"
|
||||
fetch_interval: 30 # 从 eureka 中拉取数据的时间间隔,默认30秒
|
||||
weight: 100 # default weight for node
|
||||
|
@ -513,7 +513,7 @@ GET /t
|
||||
hello1 world
|
||||
--- error_log
|
||||
Batch Processor[http logger] batch max size has exceeded
|
||||
tranferring buffer entries to processing pipe line, buffercount[2]
|
||||
transferring buffer entries to processing pipe line, buffercount[2]
|
||||
Batch Processor[http logger] successfully processed the entries
|
||||
--- wait: 1.5
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user