安装

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
docker run -d --name kong888 -e "KONG_DATABASE=off" \
     -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
     -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
     -e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
     -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
     -e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
     -p 8000:8000 \
     -p 8443:8443 \
     -p 8001:8001 \
     -p 8444:8444 kong:1.1.2-centos
# 测试     
curl -i http://localhost:8001/
curl http://localhost:8001/status |jq
docker exec -it kong888 kong reload
  • :8000 on which Kong listens for incoming HTTP traffic from your clients, and forwards it to your upstream services.
  • :8443 on which Kong listens for incoming HTTPS traffic. This port has a similar behavior as the :8000 port, except that it expects HTTPS traffic only. This port can be disabled via the configuration file.
  • :8001 on which the Admin API used to configure Kong listens.
  • :8444 on which the Admin API listens for HTTPS traffic.
1
2
3
4
# 配置文件
/usr/local/kong/nginx-kong-tream.conf
/usr/local/kong/nginx-kong.conf
/usr/local/kong/nginx.conf

集群

参考