2
votes

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?

2

2 Answers

0
votes

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?"

0
votes

I can produce this error. The traffic manager works at the DNS level, It uses DNS responses to direct clients to the appropriate service endpoint. 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.

Hope this makes sense.