项目场景:
网关跳转指定路由
问题描述
报错:找了三个小时
a.w.r.e.AbstractErrorWebExceptionHandler : [cb46a9cd-2] 500 Server Error for HTTP GET “/api/name/user?name=yupi%E3%80%82”
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost/127.0.0.1:80
spring:
cloud:
gateway:
default-filters:
- AddResponseHeader=source, yzh
routes:
- id: api_route
uri: http://localhost/:8023
predicates:
- Path=/api/**
原因分析:
提示:这里填写问题的分析:url路径错误
路径错了报的这个问题
具体为什么路径不对,它会提示80端口无法连接,我也不太清楚
下面是错误的url,因为这个是我在浏览器上直接复制的,斜杠多了一个/
—http://localhost/:8023
解决方案:
url设置正确就行了
下面正确的路径
url: http://localhost:8023