Umbraco backoffice 17 not working when deployed as an Application under main Site in IIS

Environment

  • Umbraco Version: 17.2.1

  • .NET Version: .NET 10

  • Deployment: Subdirectory (/ExampleApp)

  • Server: IIS

Issue Description

Frontend works perfectly, but backoffice returns 404s for static assets with hash-based URLs:

GET https://domain.com/ExampleApp/umbraco/backoffice/870c8e95193cce62ef84f58039b7e3c67cf719e9/css/uui-css.css 404
GET https://domain.com/ExampleApp/umbraco/backoffice/870c8e95193cce62ef84f58039b7e3c67cf719e9/css/umb-css.css 404
GET https://domain.com/ExampleApp/umbraco/backoffice/870c8e95193cce62ef84f58039b7e3c67cf719e9/apps/app/app.element.js 404

What I’ve Tried

  1. Path Base Configuration: app.UsePathBase("/ExampleApp")

  2. AppSettings: ApplicationVirtualPath and UmbracoApplicationUrl configured

  3. Static File Middleware: Various UseStaticFiles() configurations

  4. File Structure: Files exist at wwwroot/umbraco/backoffice/css/umb-css.css (flat structure)

  5. Permissions: Application pool has read access

  6. URL Rewrite: Attempted but caused 500 errors

  7. Direct File Access: Can access folders but not specific JS files in umbraco/apps/app folder.

Current Program.cs

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
.AddComposers()
.Build();

WebApplication app = builder.Build();

await app.BootUmbracoAsync();

app.UsePathBase(“/ExampleApp”);

app.UseUmbraco()
.WithMiddleware(u =>
{
u.UseBackOffice();
u.UseWebsite();
})
.WithEndpoints(u =>
{
u.UseBackOfficeEndpoints();
u.UseWebsiteEndpoints();
});

await app.RunAsync();

Current Appsettings.json

“Umbraco”: {
“CMS”: {
“Global”: {
“Id”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,
“UseHttps”: true
},
“Content”: {
“AllowEditInvariantFromNonDefault”: true,
“ContentVersionCleanupPolicy”: {
“EnableCleanup”: true
}
},
“Unattended”: {
“UpgradeUnattended”: true
},
“Security”: {
“AllowConcurrentLogins”: false
},
“Hosting”: {
“ApplicationVirtualPath”: “/ExampleApp”
},
“WebRouting”: {
“UmbracoApplicationUrl”: “``https://domain.com/ExampleApp”
}
}
}

Does anyone have an idea as to why I am getting the 404 errors?

It might help to move the path base before booting Umbraco.

But to be honest, I’m not sure if this will ever work. I think Umbraco has a few hard coded paths that simply won’t work in a subdirectory. So the above is worth a try, but I don’t have high hopes that you’ll be able to get this to work.

3 Likes

I agree with Luuk, Virtual directories/subfolders are essentially an unsupported scenario and prone to problems.

Run Umbraco in its own site with a dedicated hostname that you can use for the backoffice, then if you need your Umbraco site to work at some-site.com/some-folder/ then a reverse proxy is the best approach.

1 Like