亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Zuul 代理不路由

Zuul 代理不路由

慕無忌1623718 2021-07-20 17:16:55
在使用 spring 微服務時,我無法通過 zuul 代理路由 api這是我的代碼尤爾卡:應用程序.ymlspring:  application:    name: api  cloud:    config:      enabled: trueserver:  port: ${PORT:8761}eureka:  client:    registerWithEureka: false    fetchRegistry: false    serviceUrl:      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/  instance:    hostname: localhost祖爾:應用程序.ymlspring:  application:    name: proxy-serverserver:  port: 8079eureka:  client:    serviceUrl:      defaultZone: http://localhost:8761/eureka  fetchRegistry: truezuul:  ignored-services: '*'  prefix: /api  routes:    account:        path: /account/**        serviceId: account        stripPrefix: false  host:    socket-timeout-millis: 30000ribbion:  eureka:    enabled: true賬戶申請.ymlribbion:  eureka:    enabled: trueeureka:  instance:    preferIpAddress: true  client:    serviceUrl:      defaultZone: ${EUREKA_URI:http://localhost:8761/eureka}    instance:      preferIpAddress: true依賴:<dependencyManagement>    <dependencies>        <dependency>            <groupId>org.springframework.cloud</groupId>            <artifactId>spring-cloud-dependencies</artifactId>            <version>Finchley.SR1</version>            <type>pom</type>            <scope>import</scope>        </dependency>    </dependencies></dependencyManagement>現在 urllocalhost:8080/user/工作正常,但localhost:8080/api/account/user/拋出 404。不確定我在這里做錯了什么,任何見解都會有所幫助,如果您需要其他詳細信息,請告訴我
查看完整描述

2 回答

?
郎朗坤

TA貢獻1921條經驗 獲得超9個贊

我想您忘記在 account application.yml 中添加帳戶服務的名稱

spring:
     application:
           name: account


查看完整回答
反對 回復 2021-07-29
  • 2 回答
  • 0 關注
  • 417 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號