zuul路由中的默认配置

时间:2017-07-18 13:27:50

标签: netflix-eureka netflix-zuul

我的项目需要zuul中的默认配置路由,如下所示:

zuul:

test1:  
    service-id: TEST1  
    path: /test1/** 

resource:  
  path: /error/**  
  url: http://test/Sample 

default:  
  (This needs to be rendered whenever request has url other than above mentioned).  

有人可以帮帮我吗?

1 个答案:

答案 0 :(得分:0)

您可以将/**个网址路由放在zuul.routes的末尾,如下所示。

zuul:  
  routes:
    test1:  
      service-id: TEST1  
      path: /test1/** 
    resource:  
      path: /error/**  
      url: http://test/Sample 
    default:  
      path: /**
      url: <url that you want to forward>