I come from AWS Cloudfront where I can create multiple origins for a given endpoint.
I can serve part of the url from one origin and part from another origin.
Is there anyway we can do with Azure CDN Verizon Edgecast Premium?
EDIT1: (Cloudfront Example with Single Distribution)
https://example.com/origin1/index.html <-- This is served from origin1
https://example.com/origin2/index.html <-- This is served from origin2
or like this also,
https://example.com/endpoint/index.html <-- comes from origin1
https://example.com/endpoint/index1.html <-- comes from origin2
Here is how I solved it. Looks horrible in the modern era, but it is what it is at the time of this writing.
If you want to have multiple origins. Create one endpoint for each origin.
Endpoint1 --> Origin1
Endpoint2 --> Origin2
Create another endpoint Endpoint to create rewrite rules to those endpoints with a rewrite rule.
Endpoint3/origin1 rewrite to Endpoint1
Endpoint3/origin3 rewrite to Endpoint2
You can create rewrite rules only to other endpoints and not to any origin.
Hope it helps.
Related
I have created Azure DNS Zone to manage redirections which use domain from namecheap.
Let's assume that my website is www.johndoe.com and currently website working well for johndoe.com but when I call www.johndoe.com it doesn't work well.
I have CNAME record and in CNAME redirect to redirect but unfortunately it doesn't work.
When I have call www.johndoe.com response message is as following...
Our services aren't available right now
We're working to restore all services as soon as possible. Please check back soon.
Please take into account that DNS does not provide a redirect.
An additional A or CNAME record only provides your IP address to people that navigate to that specific URL. When www.johndoe.com and johndoe.com both resolve to your web server, this means each page on your site has two addresses. This is horrible for things like SEO.
For a true redirect (and a 301 is preferred for SEO), set something up in the service that's handling the traffic coming in.
For instance: if you have an App Service running ASP.NET, setup the redirect in web.config. If you have Front Door (or a CDN) in place, use the rules engine to create a redirect with the correct condition and action.
Here's an example redirect in an Azure Front Door Classic Resource (this one redirects the other way):
My aim is to host various microsites using Azure Statics App and then have these registered as origins in CDN.
When the user would then browse to https://www.example.com/path1, static app1 (origin1) should serve the content where as https://www.example.com/path2 should be served by static app2 (origin2).
I have tried to use the Rules engine and then setup a condition, if url path begins with /path1* with an action to override the origin group, but this doesn't seem to work.
Any ideas what should be done here?
I have a storage account in Azure with a container named clients. Inside the container I have folders for various clients, i.e:
mysite.blob.core.windows.net/clients/one
mysite.blob.core.windows.net/clients/two
I also have my own site set up as a static website, i.e:
mysite.z33.web.core.windows.net
On top of that, I have a custom domain: mysite.com. Is it possible, using Azure CDN or Azure Front Door/Application Gateway to route traffic like so (in a way that doesn't require further configuration per client):
one.mysite.com -> mysite.blob.core.windows.net/clients/one
two.mysite.com -> mysite.blob.core.windows.net/clients/two
mysite.com -> mysite.z33.web.core.windows.net
So far I have tried doing this with Azure CDN but I don't think it's possible, it has a rules engine that seems quite flexible but I don't think they support wildcard domains, unless I'm (hopefully) wrong. Ideally I'd like it to be done in some sort of wildcard way, so that is maps:
<client>.mysite.com -> mysite.blob.core.windows.net/clients/<client>
I don't really want to have to add more rules or configuration every time I have a new client.
In fact, you could use an alias record to add a root domain as the custom domains in your CDN endpoints if you use Azure CDN to host your DNS zone. In this case, you need to set up multiple endpoints for each custom domain. See this document for more details. But Pointing a zone apex to CDN endpoints for Azure CDN from Akamai is currently not supported. You can use other CDN price tier.
If you use the Azure application gateway, you may configure multiple sites listener to receive different incoming host traffic and use path-based URL rules to route the traffic to the backends. It looks like a complex configuration and hard to troubleshoot the app gw related issue.
The azure front door should also do this trick, it supports onboard a root domain on your Front Door also allows wildcard domains. The route path is also easy to configure. See path matching for more details.
Hope this information could help you.
I have created two CDN endpoints in one CDN profile with the same web app as the origin hostname. In that case, how does my CDN work? Will it route the requests to both the CDN endpoints ??
A CDN Profile is just a collection of CDN Endpoints. Endpoint is the real thing.
When you map a CDN endpoint (let's say -"my-cdn-one.azureedge.net" to a hostname (e.g. "my.host.com" - for each requested resource on the endpoint it will try to get the resource from the mapped host, for the first time. Then it will cache it for future requests on the same resource.
https://my-cdn-one.azureedge.net/files/profile.jpg >>> https://my.host.com/files/profile.jpg
The same thing will happen when you have multiple endpoints (in your case it is "2"). There will be two separate endpoints caching resources from the mapped host.
https://my-cdn-one.azureedge.net/files/profile.jpg >>> https://my.host.com/files/profile.jpg
https://my-cdn-two.azureedge.net/files/profile.jpg >>> https://my.host.com/files/profile.jpg
if you purge contents from one endpoint, the second endpoint will still have it.
We have web apps hosted on two data centers for high availability and we used traffic manager with round robin routing method to route traffic to either of the two data centers.
Now per business requirement, we need route the traffic by URL pattern. Say, for url /api/v1, route to data center 1, for url /api/v2, route to data center 2.
I know traffic manager does not support url based routing. Any workaround?
Azure Traffic Manager operates at the DNS layer and as such does not know any details about the URL related to the DNS request it receives - therefore URL based routing is not possible with Azure Traffic Manager. I encourage you to consider using Azure Application Gateway for URL based routing within a single region. For inter-region routing based on URLs, you could consider making the subdomains different and using DNS layer routing.