【问题标题】:How to ignore a route in zuul?如何忽略zuul中的路线?
【发布时间】:2018-04-25 05:59:44
【问题描述】:

我有一个 spring 应用程序,我在其中使用 zuul 进行路由。我的路由配置是这样的:

zuul:
  routes:
    core:
      path: /core/**
      url: http://localhost:3002
    ui:
      path: /**
      url: http://localhost:3003

现在我在我的应用程序中定义了一个休息控制器,它应该在其路由旁边提供验证码服务。所以我用ignored-services: /captcha/**甚至ignored-patterns: /captcha/**

但它不起作用,对验证码的请求被路由到ui 路径。

我使用的zuul版本是:org.springframework.cloud:spring-cloud-starter-zuul:1.0.3.RELEASE

【问题讨论】:

标签: java spring netflix-zuul


【解决方案1】:

它的忽略模式而不是忽略模式

zuul:
    ignoredPatterns:
        - ...........
routes:
core:
  path: /core/**
  url: http://localhost:3002
ui:
  path: /**
  url: http://localhost:3003

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-07
    • 1970-01-01
    • 2020-09-27
    • 1970-01-01
    • 2019-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多