fuguanye opened a new issue #4986:
URL: https://github.com/apache/apisix/issues/4986
### Issue description
服务发现使用为DNS后,添加路由时,服务名称一定要带端口号吗,测试发现不带端口都被转发到80端口上去了
config.yaml:
discovery:
dns:
servers:
- "127.0.0.1:8600" # use the real address of your dns server
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY:
edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"uri": "/gatewayd/*",
"upstream": {
"service_name": "gateway.service.consul"
"type": "roundrobin",
"discovery_type": "dns"
},
"plugins": {
"proxy-rewrite" : {
"regex_uri": ["^/gatewayd/(.*)", "/${1}"]
}
}
}'


而实际环境中一个服务对应多个节点,端口都是随机不一致的
不能自动获取consul 上注册上去的端口么
### Environment
- apisix version (cmd: `apisix version`): 2.9
- OS (cmd: `uname -a`): cenos 7 Linux localhost.localdomain
3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64
GNU/Linux
- OpenResty / Nginx version (cmd: `nginx -V` or `openresty
-V`):openresty/1.19.9.1
- etcd version, if have (cmd: run `curl
http://127.0.0.1:9090/v1/server_info` to get the info from server-info
API):3.5.0
- apisix-dashboard version, if have:2.7
- concul version :V1.10.2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]