Skip to content

Commit a6f0853

Browse files
authored
docs: update docs for the removal of config-default.yaml (master) (#11503)
* update reference for the config-default.yaml file * resolve mdlint errs * resolve zh lint err
1 parent 4ecc741 commit a6f0853

18 files changed

+157
-91
lines changed

docs/en/latest/FAQ.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,15 @@ deployment:
756756
password: etcd_password # password for etcd
757757
```
758758

759-
For other ETCD configurations, such as expiration times, retries, and so on, you can refer to the `ETCD` section in the `conf/config-default.yaml` file.
759+
For other ETCD configurations, such as expiration times, retries, and so on, you can refer to the `etcd` section in the sample configuration `conf/config.yaml.example` file.
760760

761-
## What is the difference between SSLs and tls.client_cert in upstream configurations, and ssl_trusted_certificate in config-default.yaml?
761+
## What is the difference between SSLs, `tls.client_cert` in upstream configurations, and `ssl_trusted_certificate` in `config.yaml`?
762762

763763
The `ssls` is managed through the `/apisix/admin/ssls` API. It's used for managing TLS certificates. These certificates may be used during TLS handshake (between Apache APISIX and its clients). Apache APISIX uses Server Name Indication (SNI) to differentiate between certificates of different domains.
764764

765765
The `tls.client_cert`, `tls.client_key`, and `tls.client_cert_id` in upstream are used for mTLS communication with the upstream.
766766

767-
The `ssl_trusted_certificate` in config-default.yaml configures a trusted CA certificate. It is used for verifying some certificates signed by private authorities within APISIX, to avoid APISIX rejects the certificate. Note that it is not used to trust the certificates of APISIX upstream, because APISIX does not verify the legality of the upstream certificates. Therefore, even if the upstream uses an invalid TLS certificate, it can still be accessed without configuring a root certificate.
767+
The `ssl_trusted_certificate` in `config.yaml` configures a trusted CA certificate. It is used for verifying some certificates signed by private authorities within APISIX, to avoid APISIX rejects the certificate. Note that it is not used to trust the certificates of APISIX upstream, because APISIX does not verify the legality of the upstream certificates. Therefore, even if the upstream uses an invalid TLS certificate, it can still be accessed without configuring a root certificate.
768768

769769
## Where can I find more answers?
770770

docs/en/latest/benchmark.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ For more reference on how to run the benchmark test, you can see this [PR](https
140140

141141
:::tip
142142

143-
If you want to run the benchmark with a large number of connections, You may have to update the **keepalive** config in the [conf/config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L242). Connections exceeding this number will become short connections. You can run the following command to test the benchmark with a large number of connections:
143+
If you want to run the benchmark with a large number of connections, You may have to update the [**keepalive**](https://github.com/apache/apisix/blob/master/conf/config.yaml.example#L241) config by adding the configuration to [`config.yaml`](https://github.com/apache/apisix/blob/master/conf/config.yaml) and reload APISIX. Connections exceeding this number will become short connections. You can run the following command to test the benchmark with a large number of connections:
144144

145145
```bash
146146
wrk -t200 -c5000 -d30s http://127.0.0.1:9080/hello

docs/en/latest/customize-nginx-configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ title: Customize Nginx configuration
2121
#
2222
-->
2323

24-
The Nginx configuration used by APISIX is generated via the template file `apisix/cli/ngx_tpl.lua` and the options from `conf/config-default.yaml` / `conf/config.yaml`.
24+
The Nginx configuration used by APISIX is generated via the template file `apisix/cli/ngx_tpl.lua` and the parameters in `apisix/cli/config.lua` and `conf/config.yaml`.
2525

2626
You can take a look at the generated Nginx configuration in `conf/nginx.conf` after running `./bin/apisix start`.
2727

28-
If you want to customize the Nginx configuration, please read through the `nginx_config` in `conf/config-default.yaml`. You can override the default value in the `conf/config.yaml`. For instance, you can inject some snippets in the `conf/nginx.conf` via configuring the `xxx_snippet` entries:
28+
If you want to customize the Nginx configuration, please read through the `nginx_config` in `conf/config.default.example`. You can override the default value in the `conf/config.yaml`. For instance, you can inject some snippets in the `conf/nginx.conf` via configuring the `xxx_snippet` entries:
2929

3030
```yaml
3131
...

docs/en/latest/install-dependencies.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ title: Install Dependencies
2525

2626
- 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.
2727

28-
- 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.
28+
- 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.yaml.example` for more details.
2929

3030
- If it is OpenResty 1.19, APISIX will use OpenResty's built-in LuaJIT to run `bin/apisix`; otherwise it will use Lua 5.1. If you encounter `luajit: lj_asm_x86.h:2819: asm_loop_ fixup: Assertion '((intptr_t)target & 15) == 0' failed`, this is a problem with the low version of OpenResty's built-in LuaJIT under certain compilation conditions.
3131

docs/en/latest/installation-guide.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ You can configure your APISIX deployment in two ways:
271271
apisix start -c <path to config file>
272272
```
273273

274-
APISIX will use the configurations added in this configuration file and will fall back to the default configuration if anything is not configured.
274+
APISIX will use the configurations added in this configuration file and will fall back to the default configuration if anything is not configured. The default configurations can be found in `apisix/cli/config.lua` and should not be modified.
275275

276276
For example, to configure the default listening port to be `8000` without changing other configurations, your configuration file could look like this:
277277

@@ -297,12 +297,6 @@ deployment:
297297

298298
:::warning
299299

300-
APISIX's default configuration can be found in `conf/config-default.yaml` file and it should not be modified. It is bound to the source code and the configuration should only be changed by the methods mentioned above.
301-
302-
:::
303-
304-
:::warning
305-
306300
The `conf/nginx.conf` file is automatically generated and should not be modified.
307301

308302
:::

docs/en/latest/plugin-develop.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -117,36 +117,36 @@ local _M = {
117117

118118
Note: The priority of the new plugin cannot be same to any existing ones, you can use the `/v1/schema` method of [control API](./control-api.md#get-v1schema) to view the priority of all plugins. In addition, plugins with higher priority value will be executed first in a given phase (see the definition of `phase` in [choose-phase-to-run](#choose-phase-to-run)). For example, the priority of example-plugin is 0 and the priority of ip-restriction is 3000. Therefore, the ip-restriction plugin will be executed first, then the example-plugin plugin. It's recommended to use priority 1 ~ 99 for your plugin unless you want it to run before some builtin plugins.
119119

120-
In the "__conf/config-default.yaml__" configuration file, the enabled plugins (all specified by plugin name) are listed.
120+
By default, most APISIX plugins are [enabled](https://github.com/apache/apisix/blob/master/apisix/cli/config.lua):
121121

122-
```yaml
123-
plugins: # plugin list
124-
- limit-req
125-
- limit-count
126-
- limit-conn
127-
- key-auth
128-
- prometheus
129-
- node-status
130-
- jwt-auth
131-
- zipkin
132-
- ip-restriction
133-
- grpc-transcode
134-
- serverless-pre-function
135-
- serverless-post-function
136-
- openid-connect
137-
- proxy-rewrite
138-
- redirect
122+
```lua title="apisix/cli/config.lua"
123+
local _M = {
124+
...
125+
plugins = {
126+
"real-ip",
127+
"ai",
128+
"client-control",
129+
"proxy-control",
130+
"request-id",
131+
"zipkin",
132+
"ext-plugin-pre-req",
133+
"fault-injection",
134+
"mocking",
135+
"serverless-pre-function",
136+
...
137+
},
139138
...
139+
}
140140
```
141141

142142
Note: the order of the plugins is not related to the order of execution.
143143

144-
To enable your plugin, copy this plugin list into `conf/config.yaml`, and add your plugin name. For instance:
144+
To enable your custom plugin, add the list of plugins into `conf/config.yaml` and append your plugin name. For instance:
145145

146146
```yaml
147-
plugins: # copied from config-default.yaml
148-
...
149-
- your-plugin
147+
plugins: # see `conf/config.yaml.example` for an example
148+
- ... # add existing plugins
149+
- your-plugin # add your custom plugin
150150
```
151151
152152
If your plugin has a new code directory of its own, and you need to redistribute it with the APISIX source code, you will need to modify the `Makefile` to create directory, such as:

docs/en/latest/plugins/aws-lambda.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Server: APISIX/2.10.2
104104
"Hello, APISIX!"
105105
```
106106

107-
Another example of a request where the client communicates with APISIX via HTTP/2 is shown below (make sure you have configured `enable_http2: true` for a in your default configuration file (`config-default.yaml`). You can do this by uncommenting the port `9081` from the field `apisix.node_listen`):
107+
Another example of a request where the client communicates with APISIX via HTTP/2 is shown below. Before proceeding, make sure you have configured `enable_http2: true` in your configuration file `config.yaml` for port `9081` and reloaded APISIX. See [`config.yaml.example`](https://github.com/apache/apisix/blob/master/conf/config.yaml.example) for the example configuration.
108108

109109
```shell
110110
curl -i -XGET --http2 --http2-prior-knowledge localhost:9081/aws\?name=APISIX

docs/en/latest/plugins/azure-functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Server: APISIX/2.10.2
119119
Hello, APISIX
120120
```
121121

122-
Another example of a request where the client communicates with APISIX via HTTP/2 is shown below (make sure you have configured `enable_http2: true` in your default configuration file (`config-default.yaml`). You can do this by uncommenting the port `9081` from the field `apisix.node_listen`):
122+
Another example of a request where the client communicates with APISIX via HTTP/2 is shown below. Before proceeding, make sure you have configured `enable_http2: true` in your configuration file `config.yaml` for port `9081` and reloaded APISIX. See [`config.yaml.example`](https://github.com/apache/apisix/blob/master/conf/config.yaml.example) for the example configuration.
123123

124124
```shell
125125
curl -i -XGET --http2 --http2-prior-knowledge http://localhost:9081/azure\?name=APISIX

docs/en/latest/plugins/inspect.md

+17-10
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,23 @@ The `info` is a hash table which contains below keys:
8787

8888
## Enable Plugin
8989

90-
Plugin is enabled by default (`conf/config-default.yaml`):
91-
92-
```yaml title="conf/config-default.yaml"
93-
plugins:
94-
- inspect
95-
96-
plugin_attr:
97-
inspect:
98-
delay: 3
99-
hooks_file: "/usr/local/apisix/plugin_inspect_hooks.lua"
90+
Plugin is enabled by default:
91+
92+
```yaml title="apisix/cli/config.lua"
93+
local _M = {
94+
plugins = {
95+
"inspect",
96+
...
97+
},
98+
plugin_attr = {
99+
inspect = {
100+
delay = 3,
101+
hooks_file = "/usr/local/apisix/plugin_inspect_hooks.lua"
102+
},
103+
...
104+
},
105+
...
106+
}
100107
```
101108

102109
## Example usage

docs/en/latest/pubsub.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ Add the required fields to the plugin schema definition and write them to the co
106106

107107
The `kafka-proxy` plugin [kafka-proxy.lua](https://github.com/apache/apisix/blob/master/apisix/plugins/kafka-proxy.lua).
108108

109-
Add this plugin to the list of plugins in the APISIX configuration file.
109+
Add this plugin to [the existing list of plugins](https://github.com/apache/apisix/blob/master/apisix/cli/config.yaml.example) in the APISIX configuration file [`config.yaml`](https://github.com/apache/apisix/blob/master/conf/config.yaml). For instance:
110110

111-
The plugins list [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml).
111+
```yaml title="conf/config.yaml"
112+
plugins: # see `conf/config.yaml.example` for an example
113+
- ... # add existing plugins
114+
- kafka-proxy
115+
```
112116
113117
#### Results
114118

docs/en/latest/terminology/plugin.md

+34-5
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,51 @@ If existing APISIX Plugins do not meet your needs, you can also write your own p
3838

3939
## Plugins installation
4040

41-
APISIX comes with a default configuration file called `config-default.yaml` and a user-defined configuration file called `config.yaml`. These files are located in the `conf` directory. If the same key (e.g. `plugins`) exists in both files, the configuration values for the key in `config.yaml` will overwrite those in `config-default.yaml`.
41+
By default, most APISIX plugins are [installed](https://github.com/apache/apisix/blob/master/apisix/cli/config.lua):
42+
43+
```lua title="apisix/cli/config.lua"
44+
local _M = {
45+
...
46+
plugins = {
47+
"real-ip",
48+
"ai",
49+
"client-control",
50+
"proxy-control",
51+
"request-id",
52+
"zipkin",
53+
"ext-plugin-pre-req",
54+
"fault-injection",
55+
"mocking",
56+
"serverless-pre-function",
57+
...
58+
},
59+
...
60+
}
61+
```
4262

43-
The `plugins` block is where you can declare the Plugins loaded to your APISIX instance:
63+
If you would like to make adjustments to plugins installation, add the customized `plugins` configuration to `config.yaml`. For example:
4464

4565
```yaml
4666
plugins:
47-
- real-ip # loaded
67+
- real-ip # installed
68+
- ai
69+
- real-ip
4870
- ai
4971
- client-control
5072
- proxy-control
5173
- request-id
5274
- zipkin
53-
# - skywalking # not loaded
54-
...
75+
- ext-plugin-pre-req
76+
- fault-injection
77+
# - mocking # not install
78+
- serverless-pre-function
79+
... # other plugins
5580
```
5681

82+
See `config.yaml.example`(https://github.com/apache/apisix/blob/master/conf/config.yaml.example) for a complete configuration reference.
83+
84+
You should reload APISIX for configuration changes to take effect.
85+
5786
## Plugins execution lifecycle
5887

5988
An installed plugin is first initialized. The configuration of the plugin is then checked against the defined [JSON Schema](https://json-schema.org) to make sure the plugins configuration schema is correct.

docs/zh/latest/FAQ.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -760,15 +760,15 @@ deployment:
760760
password: etcd_password # password for etcd
761761
```
762762

763-
关于 ETCD 的其他配置,比如过期时间、重试次数等等,你可以参考 `conf/config-default.yaml` 文件中的 `ETCD` 部分。
763+
关于 ETCD 的其他配置,比如过期时间、重试次数等等,你可以参考 `conf/config.yaml.example` 文件中的 `etcd` 部分。
764764

765-
## SSLs 对象与 `upstream` 对象中的 `tls.client_cert` 以及 `config-default.yaml` 中的 `ssl_trusted_certificate` 区别是什么?
765+
## SSLs 对象与 `upstream` 对象中的 `tls.client_cert` 以及 `config.yaml` 中的 `ssl_trusted_certificate` 区别是什么?
766766

767767
Admin API 中 `/apisix/admin/ssls` 用于管理 SSL 对象,如果 APISIX 需要接收来自外网的 HTTPS 请求,那就需要用到存放在这里的证书完成握手。SSL 对象中支持配置多个证书,不同域名的证书 APISIX 将使用 Server Name Indication (SNI) 进行区分。
768768

769769
Upstream 对象中的 `tls.client_cert`、`tls.client_key` 与 `tls.client_cert_id` 用于存放客户端的证书,适用于需要与上游进行 [mTLS 通信](https://apisix.apache.org/zh/docs/apisix/tutorials/client-to-apisix-mtls/)的情况。
770770

771-
`config-default.yaml` 中的 `ssl_trusted_certificate` 用于配置一个受信任的根证书。它仅用于在 APISIX 内部访问某些具有自签名证书的服务时,避免提示拒绝对方的 SSL 证书。注意:它不用于信任 APISIX 上游的证书,因为 APISIX 不会验证上游证书的合法性。因此,即使上游使用了无效的 TLS 证书,APISIX 仍然可以与其通信,而无需配置根证书。
771+
`config.yaml` 中的 `ssl_trusted_certificate` 用于配置一个受信任的根证书。它仅用于在 APISIX 内部访问某些具有自签名证书的服务时,避免提示拒绝对方的 SSL 证书。注意:它不用于信任 APISIX 上游的证书,因为 APISIX 不会验证上游证书的合法性。因此,即使上游使用了无效的 TLS 证书,APISIX 仍然可以与其通信,而无需配置根证书。
772772

773773
## 如果在使用 APISIX 过程中遇到问题,我可以在哪里寻求更多帮助?
774774

docs/zh/latest/benchmark.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ wrk -d 60 --latency http://127.0.0.1:9080/hello
139139

140140
:::tip
141141

142-
如果你想测试大量连接的基准测试,你可能需要更新 [`./conf/config-default.yaml`](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L242) 中的 **keepalive** 配置项,否则超过配置数量的连接将成为短连接。你可以使用以下命令运行大量连接的基准测试:
142+
如果您想使用大量连接运行基准测试,您可能需要更新 [**keepalive**](https://github.com/apache/apisix/blob/master/conf/config.yaml.example#L241) 配置,将配置添加到 [`config.yaml`](https://github.com/apache/apisix/blob/master/conf/config.yaml) 并重新加载 APISIX。否则超过配置数量的连接将成为短连接。你可以使用以下命令运行大量连接的基准测试:
143143

144144
```bash
145145
wrk -t200 -c5000 -d30s http://127.0.0.1:9080/hello

docs/zh/latest/customize-nginx-configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ title: 自定义 Nginx 配置
2121
#
2222
-->
2323

24-
APISIX 会通过 `apisix/cli/ngx_tpl.lua` 这个模板和 `conf/config-default.yaml``conf/config.yaml` 的配置生成 Nginx 配置文件
24+
APISIX 使用的 Nginx 配置是通过模板文件 `apisix/cli/ngx_tpl.lua` 以及 `apisix/cli/config.lua``conf/config.yaml` 中的参数生成的
2525

2626
在执行完 `./bin/apisix start`,你可以在 `conf/nginx.conf` 看到生成的 Nginx 配置文件。
2727

28-
在自定义 Nginx 配置文件之前,烦请仔细阅读 `conf/config-default.yaml`。你可以在 `conf/config.yaml` 里面覆盖掉默认值。举个例子,你可以通过 `xxx_snippet` 之类的配置,在 `conf/nginx.conf` 里面注入你的自定义配置
28+
如果你需要自定义 Nginx 配置,请阅读 `conf/config.default.example` 中的 `nginx_config`。你可以在 `conf/config.yaml` 中覆盖默认值。例如,你可以在 `conf/nginx.conf` 中通过配置 `xxx_snippet` 条目注入一些代码片段
2929

3030
```yaml
3131
...

docs/zh/latest/install-dependencies.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ title: 安装依赖
2525

2626
- Apache APISIX 从 v2.0 开始不再支持 `v2` 版本的 etcd,并且 etcd 最低支持版本为 v3.4.0,因此请使用 etcd 3.4.0+。更重要的是,因为 etcd v3 使用 gRPC 作为消息传递协议,而 Apache APISIX 使用 HTTP(S) 与 etcd 集群通信,因此请确保启用 [etcd gRPC gateway](https://etcd.io/docs/v3.4.0/dev-guide/api_grpc_gateway/) 功能。
2727

28-
- 目前 Apache APISIX 默认使用 HTTP 协议与 etcd 集群通信,这并不安全,如果希望保障数据的安全性和完整性。请为您的 etcd 集群配置证书及对应私钥,并在您的 Apache APISIX etcd endpoints 配置列表中明确使用 `https` 协议前缀。请查阅 `conf/config-default.yaml` 中 etcd 一节相关的配置来了解更多细节。
28+
- 目前 Apache APISIX 默认使用 HTTP 协议与 etcd 集群通信,这并不安全,如果希望保障数据的安全性和完整性。请为您的 etcd 集群配置证书及对应私钥,并在您的 Apache APISIX etcd endpoints 配置列表中明确使用 `https` 协议前缀。请查阅 `conf/config.yaml.example``etcd` 一节相关的配置来了解更多细节。
2929

3030
- 如果是 OpenResty 1.19,APISIX 会使用 OpenResty 内置的 LuaJIT 来运行 `bin/apisix`;否则会使用 Lua 5.1。如果运行过程中遇到 `luajit: lj_asm_x86.h:2819: asm_loop_fixup: Assertion '((intptr_t)target & 15) == 0' failed`,这是低版本 OpenResty 内置的 LuaJIT 在特定编译条件下的问题。
3131

0 commit comments

Comments
 (0)