charon-spring-boot-starter icon indicating copy to clipboard operation
charon-spring-boot-starter copied to clipboard

Regex Request Path Rewriter

Open justinbleach opened this issue 1 year ago • 2 comments

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

justinbleach avatar Oct 19 '23 19:10 justinbleach

paths("/kibana(?<segment>.*)", "<segment>")

sdvdxl avatar Nov 23 '23 03:11 sdvdxl

The above should do the job

mkopylec avatar Jan 26 '24 18:01 mkopylec