plugin-rewrite

Edit
Update time: 2021-03-06

Explanation

  • When making proxy invokes to the target service, soul Gateway also allows users to rewrite the request path using the rewrite plugin.

Plugin Setting

  • In soul-admin –> plugin management –> rewrite ,set to enable。

  • Introduce rewrite support in the pox.xml file of the gateway.

  • If the user don’t use, please disable the plugin in the backgroud.

  <!-- soul rewrite plugin start-->
  <dependency>
      <groupId>org.dromara</groupId>
      <artifactId>soul-spring-boot-starter-plugin-rewrite</artifactId>
     <version>${last.version}</version>
  </dependency>
  <!-- soul rewrite plugin end-->
  • Selectors and rules, please refer to: selector

    • Only those matched request will be rewritten.

Situation

  • As the name suggests, rewrite is a redefinition of URI.

  • When the request is matched, set the user-defined path, and the user-defined path will overwrite the previous real path.

  • When invoking, the user-defined path will be used.