2

I have a Traffic Manager with an endpoint in Azure Storage Static Website. Static website with index.html is up and running on both http and https. Endpoint in traffic manager has status Online.

But when try to reach static website through traffic manager DNS name http://-.trafficmanager.net I get 400 Bad Request error.

It looks like the error comes from Storage website:

The request URI is invalid.
HttpStatusCode: 400
ErrorCode: InvalidUri

Why? How to fix this?

Michael Chudinov
  • 2,620
  • 28
  • 43

2 Answers2

0

Here is the answer my to own question "How to fix?":

  1. Goto Storage Account -> Custom domain configuration

  2. Enter the traffic manager DNS name there blahblah.trafficmanager.net and save config

  3. Wait for some minutes.

Bingo! Now blahblah.trafficmanager.net shows the static website in storage account.

Note that storage account must support HTTP in order this to work properly.

Storage account -> Configuration -> Secure transfer required Disabled

Still do not have an answer to question "Why?"

Michael Chudinov
  • 2,620
  • 28
  • 43
  • Are you sure that the traffic goes thru Traffic manager? – zolty13 Feb 26 '22 at 01:05
  • No, traffic does not go through traffic manager. Traffic Manager is a DNS service, it redirects a response to the right direction. – Michael Chudinov Feb 27 '22 at 17:31
  • Yeah you right, it was shorthand. But I mean that you cannot assign domain blahblah.trafficmanager.net to two different static web apps. I am not sure whether you use traffic DNS or just traffic domain – zolty13 Feb 28 '22 at 09:12
0

I can reproduce this error. The traffic manager works at the DNS level. It uses DNS responses to redirect clients to the appropriate service endpoints. Therefore, any HTTP error you see must be coming from your application. Just like the document states

The HTTP host header sent from the client's browser is the most common source of problems. Make sure that the application is configured to accept the correct host header for the domain name you are using.

Per my understanding, we are using *.trafficmanager.net to access the static websites in blob storage, which is by default only accepting the primary endpoint host like xxx.z13.web.core.windows.net if there is no custom domain configuration. So we need to add such host *.trafficmanager.net in the blob storage.

Moreover, for endpoints using the Azure App Service, Azure automatically add a hostname *.trafficmanager.net in the custom domains of Azure App Service after you add app service endpoint. You could see Configuring a custom domain name for a web app in Azure App Service using Traffic Manager. enter image description here

Also, please note that the traffic manager cannot provide any certificate validation referring to this.

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
Nancy
  • 26,865
  • 3
  • 18
  • 34