Core Module shenyu-plugin-rewrite
Core Class org.apache.shenyu.plugin.rewrite.RewritePlugin
pom.xml file..<dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-plugin-rewrite</artifactId> <version>${project.version}</version> </dependency>
shenyu-admin --> BasicConfig --> Plugin --> rewrite set Status enabled. regex: The regular expression that matches the part of uri to be rewrited.replace: The content of replacement.percentage : The percentage of rewriting, 100 represents 100%.rewriteMetaData: Whether to rewrite metadata, true indicates that it is enabled, and once enabled, the uri can be rewritten across plugins.The request /http/hello would be rewritten to /hi
Use some tool (such as Postman) to make a request:
shenyu-admin --> BasicConfig --> Plugin --> rewrite set Status disable.