2017-04-06 2 views
0

이 경로가 http://myhost.com/v2/1234/brand/order/issues/123 인 서비스가있어서 http://anotherhost.com/issues/123으로 실제 전화를 보내야합니다.둘 이상의 단일/경로가있을 때 접두사 접두어

내가 쓸 수있는 솔루션을 피하려는 경우 ZuulFilter

방법은 말을 구성, 거기 : 접두사가 /v2/*/*/order/issues이며, 단지 123를 사용할 수 있습니까?

zuul: 
    routes: 
    test2: 
     path: /v2/*/*/orders/issues/** 
     url: http://anotherhost.com/issues/ 
     stripPrefix: true 

답변

3

아니요, 이러한 동작을 구성 할 방법이 없습니다. 사용자 정의를 생성해야합니다. ZuulFilter

기본적으로 Zuul은 특수 문자를 포함하지 않는 접두어 만 제거합니다. 예 :

zuul: 
    routes: 
    test1: 
     path: /orders/** <--- '/orders' is stripped 
     url: http://anotherhost.com/issues/ 
    test2: 
     path: /*/orders/** <--- nothing is stripped 
     url: http://anotherhost.com/issues/