diff --git a/apisix/plugins/redirect.lua b/apisix/plugins/redirect.lua index 03681991375e..4ea06bfca6b6 100644 --- a/apisix/plugins/redirect.lua +++ b/apisix/plugins/redirect.lua @@ -158,9 +158,7 @@ function _M.rewrite(conf, ctx) if not ret_port then local local_conf = core.config.local_conf() - local ssl = core.table.try_read_attr(local_conf, - "apisix", - "ssl") + local ssl = core.table.try_read_attr(local_conf, "apisix", "ssl") if ssl and ssl["enable"] then ret_port = ssl["listen_port"] if not ret_port then diff --git a/docs/en/latest/plugins/redirect.md b/docs/en/latest/plugins/redirect.md index 2a2721bc4b5d..30721a0072c8 100644 --- a/docs/en/latest/plugins/redirect.md +++ b/docs/en/latest/plugins/redirect.md @@ -47,7 +47,7 @@ Only one of `http_to_https`, `uri` and `regex_uri` can be configured. * When enabling `http_to_https`, the ports in the redirect URL will pick a value in the following order (in descending order of priority) * Read `plugin_attr.redirect_https_port` from the configuration file (`conf/config.yaml`). - * If `apisix.ssl` is enabling, read `apisix.ssl.listen_port` first, and if it does not exist, read `apisix.ssl.listen` and select a random port from it. + * If `apisix.ssl` is enabled, read `apisix.ssl.listen_port` first, and if it does not exist, read `apisix.ssl.listen` and select a port randomly from it. * Use 443 as the default https port. :::