Redirect Plugin
Explanation#
When the soul gateway makes proxy calls to the target service, it also allows users to use the redirect plugin to redirect requests.
Plugin Setting#
- In
soul-admin--> plugin management -->redirect,set to enable。 - Introduce
redirectsupport in the pox.xml file of the gateway. - If the user don't use, please disable the plugin in the background.
- Selectors and rules, only matching requests will be forwarded and redirected, please see: Selector rules。
Maven Dependency#
Add the plugin dependency in the pom.xml file of the soul-bootstrap project.
<!-- soul redirect plugin start--> <dependency> <groupId>org.dromara</groupId> <artifactId>soul-spring-boot-starter-plugin-redirect</artifactId> <version>${last.version}</version> </dependency> <!-- soul redirect plugin end-->Situation#
As the name suggests, the
redirectplugin is to re-forward and redirecturi.
Redirect#
- When we configure a custom path in
Rule, it should be a reachable service path. - When the request is matched, the
Soul Gatewaywill perform the308service jump according to the customized path.

Gateway's own interface forwarding#
- When the matching rules are met, the service will use the
DispatcherHandlerinternal interface for forwarding. - To implement the gateway's own interface forwarding, we need to use
/as the prefix in the configuration path. The specific configuration is as shown in the figure below.
