使用zuul gateway调用微服务时,转发的url地址错误
默认为true,去掉前缀 ,如果不设置就会导致转发的url地址错误
zuul.routes.fungame-pay-api.stripPrefix
当stripPrefix=true,http://127.0.0.1:7081/user-api/user/find =>http://127.0.0.1:7081/user/find
stripPrefix=false,http://127.0.0.1:7081/user-api/user/find =>http://127.0.0.1:7081/user-api/user/find
默认为true,去掉前缀 ,如果不设置就会导致转发的url地址错误
zuul.routes.fungame-pay-api.stripPrefix
当stripPrefix=true,http://127.0.0.1:7081/user-api/user/find =>http://127.0.0.1:7081/user/find
stripPrefix=false,http://127.0.0.1:7081/user-api/user/find =>http://127.0.0.1:7081/user-api/user/find
本文介绍如何正确配置Zuul网关的stripPrefix属性,以实现微服务间的URL转发。通过设置stripPrefix的值为true或false,可以决定是否去除转发URL中的前缀,避免因URL错误而导致的服务调用失败。
301

被折叠的 条评论
为什么被折叠?



