Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support multiple ports like stream listen in http and https … #2409

Merged
merged 7 commits into from
Oct 17, 2020
17 changes: 13 additions & 4 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,29 @@ If your APISIX node does not open the Admin API, then you can manually load the
apisix reload
```

## How to support multiple ports in http and https listen port?
## How to make APISIX listen on multiple ports when handling HTTP or HTTPS requests?

The Apache APISIX listens to a single port by default. If you need to support http or https to listen to multiple ports, modify the steps:
1. Modify the parameter of http port listen `node_listen`, or https port listen `ssl.listen_port` in conf/config.yaml, style like
```
By default, APISIX only listens on port 9080 when handling HTTP requests. If you want APISIX to listen on multiple ports, you need to modify the relevant parameters in the configuration file as follows:

1. Modify the parameter of HTTP port listen `node_listen` in `conf/config.yaml`, style like

```
apisix:
node_listen:
- 9080
- 9081
- 9082
```

Handling https requests is similar, Modify the parameter of HTTPS port listen `ssl.listen_port` in `conf/config.yaml`, style like

```
apisix:
ssl:
listen_port:
- 9443
- 9444
- 9445
```

2. Restart APISIX
44 changes: 26 additions & 18 deletions FAQ_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,22 +221,30 @@ curl http://127.0.0.1:9080/apisix/admin/plugins/reload -H 'X-API-KEY: edd1c9f034
apisix reload
```

## 如何支持http和https多端口监听
apisix默认监听单端口,如果需要支持http或https监听多端口,修改步骤:

1、修改conf/config.yaml中的http端口监听的配置参数`node_listen`,或https端口监听的参数`ssl.listen_port`,格式如下
```
apisix:
node_listen:
- 9080
- 9081
- 9082
ssl:
listen_port:
- 9443
- 9444
- 9445
```

2、重启APISIX
## 如何让 APISIX 在处理 HTTP 或 HTTPS 请求时监听多个端口

默认情况下,APISIX 在处理 HTTP 请求时只监听 9080 端口。如果你想让 APISIX 监听多个端口,你需要修改配置文件中的相关参数,具体步骤如下:

1. 修改`conf/config.yaml`中 HTTP 端口监听的参数`node_listen`,格式如下

```
apisix:
node_listen:
- 9080
- 9081
- 9082
```

处理 HTTPS 请求也类似,修改`conf/config.yaml`中 HTTPS 端口监听的参数``ssl.listen_port``,格式如下

```
apisix:
ssl:
listen_port:
- 9443
- 9444
- 9445
```

2. 重启 APISIX