nginx基础配置
upstream flinkui{
192.168.150.17:30000
192.168.150.18:30000
192.168.150.19:30000
}
server {
listen 80 //(http or https)
server_name flink.api.gateway.com
location / {
proxy_path http://flinkui/
}
}
对应 konga
1.配置 upstreams
只需要填写Name: flink-ups
2.填写Targets
192.168.150.17:30000
192.168.150.18:30000
192.168.150.19:30000
3.添加 services
Name flink-svc
protocol 可以写也可以不写 ,不写的话 http和https 都有
Host 写第一步upstreams 配置的名称 flink-ups
Port 写Targets 里192.168.150.17:30000 的 30000
path 看是否需要 写 /
4.配置 services 的 routes
Name flink-routes
Hosts flink.api.gateway.com 需要在dns配置 该域名指向 kong 所在主机的ip ,可以多个域名同时都指向这一个 ip
Paths /
Strip Path 设置关闭
Preserve Host 设置关闭