When the Apache ShenYu gateway makes proxy calls to the target service, it also allows users to use the redirect
plugin to redirect requests.
shenyu-admin
--> BasicConfig --> Plugin --> redirect
, set to enable.Add the plugin dependency in the pom.xml file of the shenyu-bootstrap project.
<!-- apache shenyu redirect plugin start--> <dependency> <groupId>org.apache.shenyu</groupId> <artifactId>shenyu-spring-boot-starter-plugin-redirect</artifactId> <version>${project.version}</version> </dependency> <!-- apache shenyu redirect plugin end-->
As the name suggests, the
redirect
plugin is to re-forward and redirecturi
.
Rule
, it should be a reachable service path.ShenYu Gateway
will perform the 308
service jump according to the customized path.DispatcherHandler
internal interface for forwarding./
as the prefix in the configuration path. The specific configuration is as shown in the figure below.