我正在使用 Spring Boot 微服务。我已经配置了 eureka、zuul 代理和另一个微服务(帐户)。如果我直接从帐户拨打电话,则工作正常。帐户和 zuul 服务器都显示在 eureka 上。
当我尝试使用 zuul 代理进行访问时,它会获取状态代码200OK
但没有得到任何结果
以下是我的zuul配置
Zuul.yml
server:
port: 8076
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://localhost:8078/eureka/
instance:
hostname: localhost
health-check-url-path: /actuator/health
status-page-url-path: /actuator/info
logging:
level:
com.netflix.discovery: 'ON'
org.springframework.cloud: DEBUG
zuul:
ignoredServices: '*'
routes:
account:
serviceId: ACCOUNT
url: http://192.168.0.62:8081/
stripPrefix: false
predicate:
- Path=/accounts/**
debug:
requests: true
management:
security:
enabled: false
endpoints:
web:
exposure:
include: '*'
到目前为止的控制台日志
路由匹配=ZuulRoute{id='account', path='/account/**',
serviceId='账户', url='http://192.168.0.62:8081/ http://192.168.0.62:8081/',
stripPrefix = false,可重试= null,sensitiveHeaders = [],
自定义敏感标头=假,}
--------------------------- 映射到 org.springframework.cloud.netflix.zuul.web.ZuulController@7bb67520
执行器/env 的日志
"zuul.ignoredServices": {
"value": "*"
},
"zuul.routes.account.serviceId": {
"value": "ACCOUNT"
},
"zuul.routes.account.url": {
"value": "http://192.168.0.62:8081/"
},
"zuul.routes.account.stripPrefix": {
"value": false
},
"zuul.routes.account.predicate[0]": {
"value": "Path=/accounts/**"
},
"zuul.debug.requests": {
"value": true
},
"management.security.enabled": {
"value": false
},
"management.endpoints.web.exposure.include": {
"value": "*"
}
如果有东西丢失,我无法从这里得到任何东西,请检查并告诉我。任何帮助都会有用的
thanks.
如果需要更多信息,请告诉我。