Redirecting problems and custom domain in App service behind Cloudfront

Cathinka Walberg 96 Reputation points


We recently changed from on premise hosting to Azure for our Episerver site, and are experiencing problems with redirects within our site. The solutions keeps redirecting to the url instead of the custom domain, and we are bit lost as to what we have done wrong with the configuration of our site in Azure.

Our site consits of two solutions: the Episerver site and another solution. All urls appart from /other-solution redirects to our Episerver which runs as an app service. Because of performance issues in the other solution (and our previous on premise hosting) we have CloudFront. This means that request to our custom domain are sent to CloudFront, which then routes the traffic to the correct solution.
We are now however experiencing issues with redirects in our Episerver solution, as redirects in code sends our users to url instead of the custom domain.

The custom domain is not set up in Azure and we are not redirecting the host header from CloudFront. This worked at first when we moved the hosting to Azure, but the problems seams to have started happening after a big update where we amongst others updated to .Net Framework 4.7.2 from 4.6.1 and also updated Episerver from 11.11.2 to 11.14.0.

Does anyone have any idea about what we have done wrong?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,372 questions
0 comments No comments
{count} votes

Accepted answer
  1. Cathinka Walberg 96 Reputation points

    What looks to have solved the issue for us is whitelisting the host header in Cloudfront and adding our custom domain to Azure. To be able to do the latter we also had to add it in out DNS as a TXT record.

    We based our solution on, amonst others, these pages:

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SYNGOUROGLOU Georgios 0 Reputation points

    We faced a similar problem which was fixed when we added a front slash at the end of our links. An example below.

    # This was redirecting visitors to the * domain of our resource
    # This wasn't
    0 comments No comments