Open Closed

Issue with ABP on an Azure AppService behind Azure Frontdoor #1021


User avatar
0
davidferreirarodrigues@gmail.com created
  • ABP Framework version: latest
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Steps to reproduce the issue:

We have an ABP portal deployed to an Azure AppService, no issues here. We have place an Azure Frontdoor in front, to handle top level SSL.

What is happening now is that the user comes in through the custom domain, let's say: "abp.customdomain.com" and he get's a 301 redirect right away into the Azure AppService hostname, let's say "abp-my-app.azurewebsites.net" and they stays here.

Frontdoor will write proper forward headers to the backend, so the first try we did here was to do:

services.Configure<ForwardedHeadersOptions>(options =>
{
    options.ForwardedHeaders = ForwardedHeaders.All;
    options.AllowedHosts.Clear();
});

Combined with: app.UseForwardedHeaders();

But no Joy.

Then we tried to specifically set the Host

            app.UseAbpRequestLocalization();

            if (!env.IsDevelopment())
            {
                app.UseErrorPage();
            }

            app.Use((ctx, next) =>
            {
                ctx.Request.Host = new HostString("abp.customdomain.com");
                return next();
            });

            app.UseVirtualFiles();
            app.UseRouting();

No joy again.

How can we control ABPs behaviour with redirects when it's sitting behind an Azure Frontdoor?


2 Answer(s)
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    So Abp application is deployed to Azure AppService with a domain name abp-my-app.azurewebsites.net. But when the custom abp.customdomain.com domain is requested, it should redirect to abp-my-app.azurewebsites.net but currently it doesn't. Is it the issue?

    If so, it seems related with Azure Frontdoor configuration; not the application.

    If that is not the case, can you give more detail about the problem?

    How can we control ABPs behaviour with redirects when it's sitting behind an Azure Frontdoor?

    And no, Abp doesn't have a specific redirect behaviour.

  • User Avatar
    0

    Hi,

    Sorry for the late reply. It was indeed an AppService redirect that was causing the issue, so no ABP related. Closing this now.

    Thanks! David

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19