Skip to content

Commit

Permalink
docs: add fallbck_sni faq (#8215)
Browse files Browse the repository at this point in the history
* docs: add  fallbck_sni faq

* docs: fix error link
  • Loading branch information
guitu168 authored Nov 14, 2022
1 parent dc4b354 commit 288708c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
19 changes: 18 additions & 1 deletion docs/en/latest/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
title: FAQ
keywords:
- APISIX
- API Gateway
- FAQ
description: This article lists solutions to common problems when using Apache APISIX.
---

<!--
Expand Down Expand Up @@ -58,7 +63,7 @@ It does the following dynamically:
- Health checks
- Traffic split

## Does Apache APISIX have a user interface
## Does Apache APISIX have a user interface?

Yes. Apache APISIX has an experimental feature called [Apache APISIX Dashboard](https://github.com/apache/apisix-dashboard), which is independent from Apache APISIX. To work with Apache APISIX through a user interface, you can deploy the Apache APISIX Dashboard.

Expand Down Expand Up @@ -281,6 +286,18 @@ To configure Apache APISIX to listen on multiple ports, you can:
2. Reload or restart Apache APISIX.
## After uploading the SSL certificate, why can't the corresponding route be accessed through HTTPS + IP?
If you directly use HTTPS + IP address to access the server, the server will use the IP address to compare with the bound SNI. Since the SSL certificate is bound to the domain name, the corresponding resource cannot be found in the SNI, so that the certificate will be verified. The authentication fails, and the user cannot access the gateway via HTTPS + IP.
You can implement this function by setting the `fallback_sni` parameter in the configuration file and configuring the domain name. When the user uses HTTPS + IP to access the gateway, when the SNI is empty, it will fall back to the default SNI to achieve HTTPS + IP access to the gateway.
```yaml title="./conf/config.yaml"
apisix
ssl:
fallback_sni: "${your sni}"
```

## How does Apache APISIX achieve millisecond-level configuration synchronization?

Apache APISIX uses etcd for its configuration center. etcd provides subscription functions like [watch](https://github.com/api7/lua-resty-etcd/blob/master/api_v3.md#watch) and [watchdir](https://github.com/api7/lua-resty-etcd/blob/master/api_v3.md#watchdir) that can monitor changes to specific keywords or directories.
Expand Down
18 changes: 18 additions & 0 deletions docs/zh/latest/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
title: 常见问题
keywords:
- APISIX
- API 网关
- 常见问题
- FAQ
description: 本文列举了使用 Apache APISIX 时常见问题解决方法。
---

<!--
Expand Down Expand Up @@ -284,6 +290,18 @@ nginx_config:
2. 重启或者重新加载 APISIX。
## 启用 SSL 证书后,为什么无法通过 HTTPS + IP 访问对应的路由?
如果直接使用 HTTPS + IP 地址访问服务器,服务器将会使用 IP 地址与绑定的 SNI 进行比对,由于 SSL 证书是和域名进行绑定的,无法在 SNI 中找到对应的资源,因此证书就会校验失败,进而导致用户无法通过 HTTPS + IP 访问网关。
此时你可以通过在配置文件中设置 `fallback_sni` 参数,并配置域名,实现该功能。当用户使用 HTTPS + IP 访问网关时,SNI 为空时,则 fallback 到默认 SNI,从而实现 HTTPS + IP 访问网关。
```yaml title="./conf/config.yaml"
apisix
ssl:
fallback_sni: "${your sni}"
```

## APISIX 如何利用 etcd 如何实现毫秒级别的配置同步?

Apache APISIX 使用 etcd 作为它的配置中心。etcd 提供以下订阅功能(比如:[watch](https://github.com/api7/lua-resty-etcd/blob/master/api_v3.md#watch)[watchdir](https://github.com/api7/lua-resty-etcd/blob/master/api_v3.md#watchdir))。它可以监视对特定关键字或目录的更改。
Expand Down
8 changes: 4 additions & 4 deletions docs/zh/latest/plugins/hmac-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ print(base64.b64encode(hash.digest()))
| --------- | -------------------------------------------- |
| SIGNATURE | 8XV1GB7Tq23OJcoz6wjqTs4ZLxr9DiLoY4PxzScWGYg= |

你也可以参考 [Generating HMAC signatures](../examples/plugins-hmac-auth-generate-signature.md) 了解如何为不同的编程语言生成签名
你也可以参考 [Generating HMAC signatures](../../../en/latest/examples/plugins-hmac-auth-generate-signature.md) 了解如何使用不同的编程语言生成签名

签名生成后,你可以通过以下示例使用生成的签名发起请求:

Expand Down Expand Up @@ -335,14 +335,14 @@ Accept-Ranges: bytes
:::note 注意

1. ACCESS_KEY、SIGNATURE、ALGORITHM、DATE、SIGNED_HEADERS 分别代表对应的变量。
2. SIGNED_HEADERS 为客户端指定的加入加密计算的 headers。若存在多个 headers 需以 “;” 分割,例如:`x-custom-header-a;x-custom-header-b`
2. SIGNED_HEADERS 为客户端指定的加入加密计算的 headers。若存在多个 headers 需以 `;` 分割,例如:`x-custom-header-a;x-custom-header-b`
3. SIGNATURE 需要使用 base64 进行加密:`base64_encode(SIGNATURE)`

:::

### 自定义 header 名称

除了配置签名外,你还可以在配置文件(`conf/config.yaml`)中的`plugin_attr` 配置项下,添加 `hmac-auth` 插件的属性来自定义参数 header 名称。如下所示:
除了配置签名外,你还可以在配置文件(`conf/config.yaml`)中的 `plugin_attr` 配置项下,添加 `hmac-auth` 插件的属性来自定义参数 header 名称。如下所示:

```yaml title="conf/config.yaml"
plugin_attr:
Expand Down Expand Up @@ -380,7 +380,7 @@ Accept-Ranges: bytes

## 禁用插件

当你需要禁用 `hmac-auth` 插件时,可以通过以下命令删除相应的 JSON 配置,APISIX 将会自动重新加载相关配置,无需重启服务:
当你需要禁用该插件时,可以通过以下命令删除相应的 JSON 配置,APISIX 将会自动重新加载相关配置,无需重启服务:

```shell
curl http://127.0.0.1:9180/apisix/admin/routes/1 \
Expand Down

0 comments on commit 288708c

Please sign in to comment.