zuul the strip-prefix and prefix

  • prefix : prefix matching prefix request when the agent will be.
  • prefix-Strip : default prefix delegation request will be removed from the path, is removed off by the setting function.

When stripPrefix = true

  The default configuration, will automatically remove the prefix forwarding;

Zuul: 
  routes: 
    API: # alias routing, custom can be no other meaning 
      stripPrefix: true # prefix in the path will be removed 
      serviceId: Server-API 
      path: / API / **

When an external request to  http: // localhost: 9000 / api  / getTest when, through the gateway forwarding path: HTTP: // localhost: 9000 / getTest productId = 20? 

When stripPrefix = false

It does not remove the prefix forwarding;

Zuul: 
  routes: 
    API: # alias routing, custom can be no other meaning 
      stripPrefix: false # prefix in the path will not be removed 
      serviceId: Server-API 
      path: / API / **

When an external request to  http: // localhost: 9000 / api  / getTest when, through the gateway forwarding path: HTTP: // localhost: 9000 / getTest productId = 20?  

Guess you like

Origin www.cnblogs.com/tongxuping/p/12626464.html