parca icon indicating copy to clipboard operation
parca copied to clipboard

PathPrefix should also append a prefix to /api calls

Open TomHellier opened this issue 3 years ago • 1 comments

I am trying out the continuous profiling tool on a cluster I operate, I really like it so far!

I typically deploy my applications on a subpath, for example: example.com/parca/

I attempted to use the Flag PathPrefix, but this appears to only work for the UI resources, and when the web app attempted to access the /api/ endpoint, it used example.com/api/ instead of what I was expecting, example.com/parca/api

I tried to set the environment variable: REACT_APP_PUBLIC_API_ENDPOINT to https://example.com/parca/, but I suspect that only works when running webpack dev server

TomHellier avatar Sep 02 '22 22:09 TomHellier

Yes, seems like you're right. The grpcWebMux gets registered against the internalMux and we don't use the prefix there... https://github.com/parca-dev/parca/blob/main/pkg/server/server.go#L146

metalmatze avatar Sep 05 '22 10:09 metalmatze