orlabs / orange

OpenResty/Nginx Gateway for API Monitoring and Management.
http://orange.sumory.com
MIT License
2.3k stars 572 forks source link

分流插件的upstream url配置域名的时候出现could not be resolved的错误 #190

Closed lufeng4828 closed 6 years ago

lufeng4828 commented 6 years ago
需求或场景

我后端的微服务是通过域名访问的,我希望通过插件分流到微服务

使用的插件

divide

具体的配置

divide

期望的结果

访问:gateway.xxx.com/baas/system/check 返回后端传回的数据

错误的结果

2

多谢指教!

lufeng4828 commented 6 years ago

问题找到了,我用其他框架的时候会解析/etc/resolv.conf search stage.svc.xxxx.local svc.ofidc.local xxxx.local 所以通过ping bgw-app自动匹配,但是在openresty里面好像不通过/etc/resolv.conf,所以在orange里面要用全称: bgw-app.stage.svc.xxxx.local