Hello,
So I am trying to set up an umbraco 13 site in .net 8 with a reverse proxy. E.g mysite-frontend.com/path-test points to mybackendwebsite.com throught cloudflare.
I have set this up in my program.cs:
if (_config[“Proxy:SiteUrl”].Contains(“/path-test”))
{
app.Use((ctx, next) =>
{
var url = _config[“Proxy:CanonicalUrl”];
var canonical = url.StartsWith(“https://”)
? url.Substring(“https://”.Length)
: url;
ctx.Request.Host = new HostString(canonical);
ctx.Request.Scheme = "https";
ctx.Request.PathBase = "/path-test";
return next();
});
app.UsePathBase("/path-test");
}
However, this uses path-test twice. in all umbraco calls. If I remove ‘ctx.Request.PathBase = “/path-test”;’ then the calls work but no css loads on the front end. If I remove ‘app.UsePathBase(“/path-test”);’ then I cannot access umbraco but the front end works.
I have tried using this but it doesn’t seem to work with a path inside of it:
"Umbraco": {
"CMS": {
"WebRouting": {
"UmbracoApplicationUrl": "http://www.mysite.com/"
}
}
}
Just wondering if anyone had any similar issues using a proxy. Any help would be very appreicated.