Umbraco backend error

I am using umbraco 17.4.2, application is hosted in Ubuntu server under docker container with nginx reverse proxy. Now my problem is that, the umbraco backend does not work on the server. The website itself is working fine. When I go to /umbraco, it redirects to login page. After successful login, it redirects to the following URL with 404 error.

https://circlecart.app/umbraco/management/api/v1/security/back-office/authorize?client_id=umbraco-back-office&redirect_uri=https%3A%2F%2Fcirclecart.app%2Fumbraco%2Foauth_complete&scope=offline_access&response_type=code&state=BhUy9zKRkHKWBLY1EyHcbBrkY8NF8UcV&code_challenge=TFflfkjf1p1zCU2esh_Wf57x8-g7i_aC6_1Iqn4Nyrs&code_challenge_method=S256&prompt=consent&access_type=offline

I saw several blogs relating to this issue, but none of them could help. I have the following settings in appsettings.json

"CMS": {
  "Global": {
    "UmbracoApplicationUrl": "https://circlecart.app"
  },
  "WebRouting": {
    "UmbracoApplicationUrl": "https://circlecart.app"
  },
  "Security": {
    "AllowUnsecureBackOfficeHttp": true,
    "BackOfficeHost": "http://circlecart.app"
  },
  "RuntimeMinification": {
    "UseRuntimeMinification": true
  },
  "DeliveryApi": {
    "Enabled": true
  },
  "Content": {
    "MacroErrors": "Throw"
  },
  "Hosting": {
    "Debug": true
  },
  "Deploy": {
    "Settings": {
      "ApiSecret": "xxxxxxxxxxxxxxxxxxx"
    }
  },
  "Project": {
    "CurrentWorkspaceName": "Live",
    "Workspaces": [
      {
        "Id": "efef5e89-a19b-434b-b68a-26e022a0ad52",
        "Name": "Live",
        "Type": "live",
        "Url": "https://circlecart.app"
      }
    ]
  }
}

This part of my Program.cs

builder.Services.Configure<ForwardedHeadersOptions>(options =>
{
    options.ForwardedHeaders =
        ForwardedHeaders.XForwardedFor |
        ForwardedHeaders.XForwardedProto |
        ForwardedHeaders.XForwardedHost;

    options.KnownIPNetworks.Clear();
    options.KnownProxies.Clear();

    options.RequireHeaderSymmetry = false;
});

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

var app = builder.Build();

// Boot Umbraco
await app.BootUmbracoAsync();
app.UseForwardedHeaders();

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

Can anyone please help? Thank you

Hi Kiran :waving_hand:

This may be a long shot, but we had a similar problem after an upgrade to v17 on a webhost that apparently does some kind of reverse-proxying. The solution here was to set UseHttps to false - I don’'t see that in your code (and the default in v17 is true) so might be something to try?

/Chriztian

Thank you Chriztian for your response. I added this in the appsettings.json.

Still getting the same issue

"Umbraco": {
  "CMS": {
    "Global": {
      "Id": "05e31665-5977-402a-a92d-92298494be44",
      "SanitizeTinyMce": true,
      "UseHttps": false
    },

maybe the issue might be simple:

your BackOfficeHost is set to http:// but the site runs on https:// - that’s going to cause the OAuth redirect_uri to be generated with the wrong scheme.? js a thought from top of my head

Thank you Bishal, I tried both true and false for UseHttps, but no luck. Actually the site running under docker container with nginx reverse proxy. Container exposes http port 8080. nginx on the hosting server handles https and certificates.