I assume that your .net app has a reverse proxy in front of it that allows you to you to proxy each sub path to your different applications ?
I can see two ways you can sort this problem :
- If the reverse proxy use X-Forwarded headers. You could use the forwarded header middleware with ForwardedHeaders. XForwardedPrefix
- Worst come to worst : adjust the base path of the application with app.UsePathBase(app.Configuration["EnvVariableHavingYourSubpath"]) which does require altering the reverse proxy to tell it to also use the subpath for the forwarded requests.