mkopylec / charon-spring-boot-starter

Reverse proxy implementation in form of a Spring Boot starter.
Apache License 2.0
240 stars 54 forks source link

Regex Request Path Rewriter #142

Open justinbleach opened 8 months ago

justinbleach commented 8 months ago

Hi. Just need some clarification. Having a hard time understanding the path - template relationship.

Let's say all requests to /kibana go to http://10.6.12.20:5601

When that site loads it pulls in some javascript files etc to load the Kibana site. How can I make all subsequent requests on /kibana to go straight to http://10.6.12.20:5601 . E.g. /kibana/plugins & /kibana/ui/favicons go to http://10.6.12.20:5601/plugins & http://10.6.12.20:5601/ui/favicons

I tried something like: .add(requestMapping("kibana") .pathRegex("/kibana.") .set(regexRequestPathRewriter().paths("/(?.)", "/")) .set(requestServerNameRewriter().outgoingServers(http://10.6.12.20:5601 )));

But I'm getting a double path /kibana//kibana

sdvdxl commented 7 months ago
paths("/kibana(?<segment>.*)", "<segment>")
mkopylec commented 5 months ago

The above should do the job