You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sy...@apache.org on 2022/11/14 08:21:12 UTC

[apisix] branch master updated: docs: add fallbck_sni faq (#8215)

This is an automated email from the ASF dual-hosted git repository.

sylviasu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 288708cbe docs: add fallbck_sni faq (#8215)
288708cbe is described below

commit 288708cbe0098fd3f62fadd725490804d5d0a3db
Author: Fei Han <97...@users.noreply.github.com>
AuthorDate: Mon Nov 14 16:21:03 2022 +0800

    docs: add fallbck_sni faq (#8215)
    
    * docs: add  fallbck_sni faq
    
    * docs: fix error link
---
 docs/en/latest/FAQ.md               | 19 ++++++++++++++++++-
 docs/zh/latest/FAQ.md               | 18 ++++++++++++++++++
 docs/zh/latest/plugins/hmac-auth.md |  8 ++++----
 3 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/docs/en/latest/FAQ.md b/docs/en/latest/FAQ.md
index b8aaf2b0d..0952146cd 100644
--- a/docs/en/latest/FAQ.md
+++ b/docs/en/latest/FAQ.md
@@ -1,5 +1,10 @@
 ---
 title: FAQ
+keywords:
+  - APISIX
+  - API Gateway
+  - FAQ
+description: This article lists solutions to common problems when using Apache APISIX.
 ---
 
 <!--
@@ -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.
 
@@ -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.
diff --git a/docs/zh/latest/FAQ.md b/docs/zh/latest/FAQ.md
index 0f4356f13..ad5c6d4f4 100644
--- a/docs/zh/latest/FAQ.md
+++ b/docs/zh/latest/FAQ.md
@@ -1,5 +1,11 @@
 ---
 title: 常见问题
+keywords:
+  - APISIX
+  - API 网关
+  - 常见问题
+  - FAQ
+description: 本文列举了使用 Apache APISIX 时常见问题解决方法。
 ---
 
 <!--
@@ -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))。它可以监视对特定关键字或目录的更改。
diff --git a/docs/zh/latest/plugins/hmac-auth.md b/docs/zh/latest/plugins/hmac-auth.md
index e709df894..8621611d9 100644
--- a/docs/zh/latest/plugins/hmac-auth.md
+++ b/docs/zh/latest/plugins/hmac-auth.md
@@ -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) 了解如何使用不同的编程语言生成签名。
 
 签名生成后,你可以通过以下示例使用生成的签名发起请求:
 
@@ -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:
@@ -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 \