React UI that authenticates with Okta and talks over a websocket to a Java backend

So for that you’ll want handle_path instead, because in Caddy, the path is kept, not stripped, by default. handle_path is the same as handle, except that it also strips the prefix from the path before doing the rest.

But you should be aware that you may need to change some configuration on your React app such that the right assets are loaded on every page (there might be a base path configuration option to ensure that /ui/ is prefixed on asset paths).