version: "2.3"
services:
apisix:
image: apache/apisix:2.4-alpine
environment:
- "TZ=Asia/Shanghai"
ports:
- "80:80/tcp"
- "443:443/tcp"
# - "9180:9180/tcp"
privileged: true
sysctls:
- net.core.somaxconn=20480
restart: always
volumes:
# - apisixlogdata1:/usr/local/apisix/logs
- '/Application/docker/conf/apisix/2.4/config.yaml:/usr/local/apisix/conf/config.yaml:ro'
# - '/Application/docker/conf/apisix/2.4/config-default.yaml:/usr/local/apisix/conf/config-default.yaml:ro'
# - '/Application/docker/conf/apisix/etc/ssl/openssl.cnf:/usr/local/openresty/openssl/ssl/openssl.cnf:ro'
# - '/Application/docker/conf/apisix/2.4/usr/local/apisix/apisix/cli/ngx_tpl.lua:/usr/local/apisix/apisix/cli/ngx_tpl.lua:ro'
network_mode: host
version: "3"
services:
etcd:
# if you are in the mainland China, please use Azure China mirror:
image: docker pull quay.io/coreos/etcd:v3.4.15
command: /usr/local/bin/etcd
restart: always
volumes:
- etcddata1:/etcd_data
environment:
# - ALLOW_NONE_AUTHENTICATION=yes
- ETCDCTL_API=3
- ETCD_DATA_DIR=/etcd_data
- ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_LISTEN_CLIENT_PEER_URLS=http://127.0.0.1:2380
- TZ=Asia/Shanghai
network_mode: host
ports:
- "0.0.0.0:2379:2379/tcp"
volumes:
etcddata1:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '/data/docker/etcd/node1'
{
"uris": [
"/*"
],
"name": "apisix_proxy_dashboard",
"upstream": {
"nodes": [
{
"host": "127.0.0.1",
"port": 9000,
"weight": 1
}
],
"type": "roundrobin"
},
"status": 1
}
OR
# route
{
"uris": [
"/*"
],
"name": "https_pilot",
"desc": "https://pilot.x.info",
"priority": 10,
"hosts": [
"pilot.x.info"
],
"upstream_id": "349271367952106974",
"status": 1
}
# upstream
{
"nodes": [
{
"host": "127.0.0.1",
"port": 9000,
"weight": 10
}
],
"timeout": {
"connect": 6000,
"read": 60000,
"send": 60000
},
"type": "roundrobin",
"pass_host": "pass",
"name": "apisix manager api",
"desc": "apisix manager api"
}
Access this route via ip or:
https://pilot.x.info/user/login?redirect=%2F
Input user && password, press login

Left: Access dashboard via APISIX,
Right: Direct access dashboard via http://ip:9000
apisix version): apisix:2.4-alpineuname -a): CentOS 7 ( dashboard 2.5 rpm)nginx -V or openresty -V): apisix:2.4-alpine bundled openrestycurl http://127.0.0.1:9090/v1/server_info to get the info from server-info API): 3.4.15Access Dashboard through APISIX proxy, Keep the APISIX proxy port and Admin API port different(or disable Admin API). For example, do the following configuration in conf/config.yaml.
The Admin API use a separate port 9180:
apisix:
port_admin: 9180 # use a separate port
Access Dashboard through APISIX proxy, Keep the APISIX proxy port and Admin API port different(or disable Admin API). For example, do the following configuration in
conf/config.yaml.The Admin API use a separate port 9180:
apisix: port_admin: 9180 # use a separate port
It works. I am wondering why should this happen...? Port conflict or?
+++ b /conf/apisix/2.4/config.yaml
@@ -1,6 +1,7 @@
apisix:
node_listen: 80 # APISIX listening port
enable_ipv6: false
+ port_admin: 9180
It works. I am wondering why should this happen...? Port conflict or?
Because Dashboard access needs to occupy the port of /apisix/admin/xxx, and on the data side, the default APISIX and Admin API listening ports are the same. When using APISIX proxy to access Dashboard, it will conflict with APISIX's Admin API listening interface. Therefore, we need to customize the Admin API port to avoid conflicts, or disable the Admin API.
Most helpful comment
Because Dashboard access needs to occupy the port of
/apisix/admin/xxx, and on the data side, the default APISIX andAdmin APIlistening ports are the same. When using APISIX proxy to access Dashboard, it will conflict with APISIX'sAdmin APIlistening interface. Therefore, we need to customize the Admin API port to avoid conflicts, or disable the Admin API.