Akamai Sureroute - Path based routing - akamai

We are using Akamai to route requests from internet to our network. I do not have access to the Akamai configurations/settings to verify how it has been set up or what all features we use. As per information I have, we are using Akamai Sureroute to set up redirection like below -
myapp.company.com (apps public URL) > Akamai Edge Server > Akamai Sureroute path > company network load balancer > myapp server
Now we have two versions of this "myapp". One running in cloud and another on-prem. Would the below be possible to set up in Akamai -
Public URL for accessing both the cloud and on-prem versions should remain the same i.e. myapp.company.com.
Based on the path, Akamai should be able to route the request either to cloud load balancer or on-prem load balancer.
For eg: myapp.company.com/path1 should go to cloud load balancer > cloud myapp
myapp.company.com/path2 should go to on-prem load balancer > on-prem myapp

Yes, it's possible. Akamai configurations allow to change the route to origin servers. With using the match conditions, users can go to the different origin servers.
Matches (Path is available for the match condition)
https://techdocs.akamai.com/property-mgr/docs/matches
Add your origin server (Origin Server can be added for the specific condition)
https://techdocs.akamai.com/property-mgr/docs/add-an-origin-server-to-your-property

Related

need setup help for google cdn with wordpress

How can i setup cloud CDN? I have followed the guides.
After creating load balancer and backend service with Internet network endpoint group
Can i use mydomain.com in google cdn or I have to use cdn.mydomain.com?
As on cloudflare you can use main domain for cdn (mydomain.com) but i am not able to use in google cdn.
After creating the CDN, should i create A name ? (If i create A name - i have to delete main A name)
My server is on aws lightsail and dns is on namecheap
How can i add A name ? I am confused
Help will be appreciated.
The Domain configuration/setup has nothing to do with CDN and it is a caching service. For domain mapping, you have to use Google Cloud DNS. Similar to Cloudflare which provides DNS service, you can configure just main domain(domain.com) or also subdomain in the Google Cloud DNS [1]
If you are about to map/setup your domain in Google Cloud DNS,
i) The NS records which are created in the Google Cloud DNS once the zone is created, needs to be updated in the Namecheap site so that the connectivity between registered domain and NS in Google DNS is established.
ii) Then ‘A name’ needs to be created in Google Cloud DNS to map the domain with the external IP address of the hosting server and the same detail also needs to be updated with your domain registrar i.e., Namecheap.
iii) If you are making use of Load balancer, then make sure that A records of your domain are pointing to the IP address of your load balancer so the traffic going to your website will be rerouted to LB and checked if they are cacheable for Cloud CDN.
To make use of Google CDN, you just need to enable/disable CDN while configuring load balancer -> backend services [2] and if you are using Internet NEG, you need to map the domain name in the Create a network endpoint group page.
[1]https://cloud.google.com/dns/docs/quickstart#update_your_domain_name_servers
[2]https://cloud.google.com/cdn/docs/setting-up-cdn-with-external-origin
Regards,
Anbu.

AWS setup: moving single page static application frontend to S3 (from web server)

My current website (single page app with CORS + API) is deployed on AWS EC2 instance and is served via ALB (mostly for easier setup of HTTPS as I only have one region covered now). The web server is configured to serve the single page application but that's all it is doing regarding frontend. I want to move the single page application to S3 instead and so completely separate the backend from the frontend. The question is, what would be the most efficient way to do it with regards to AWS setup? I can come up with the following:
point the domain at the S3 instance to serve frontend files, point API calls to ALB public DNS address
keep the domain pointed at the ELB as it is, route port 80 & 443 to S3, change API port and route that port to EC2
...
Any help appreciated.
If you're trying to completely separate the infrastructure for frontend and backend but keep the same domain you could make use of CloudFront.
In CloudFront you would create 2 origins within your distribution:
The default origin would be the S3 static website.
Then an additional origin which would point to the original ALB.
You would configure the behaviours of this CloudFront distribution so that when a path matches a specific pattern i.e. api/* it would forward traffic to the ELB. If it does not match this it would default to your S3 bucket.
Take a look at the Can I use a single CloudFront web distribution to serve content from multiple origins using multiple behaviors? article which covers a similar behaviour to what I have outlined.

Google Cloud CDN cache media folder only

I am using a magento application and I need to cache only the "/media" path where images are stored on Google Cloud CDN.
Actually I've configured one instance group where my VM is running the whole website application and enabled Google Cloud CDN via the checkbox on the backend part.
It appears that every http request are send to Google Cloud CDN.
How to cache only the media path files ?
You should use separate backends and the URL Map feature of the HTTP Load Balancer.
Based on URL Map, the Target HTTP Proxy will check each request and determine the appropriate backend service for the request. This way you can enable or disable Cloud CDN use for a particular backend (which means for a particular URL) with a single checkbox.
The Host and path rules are configured as part of the HTTP Load Balancer in the Cloud Console menu:
GCP Navigation => Networking => Network Services => Load balancing
=> Create load balancer => HTTP(S) Load Balancing => Start configuration
=> From Internet to my VMs => Host and path rules
Load Balancing > Doc > URL maps overview
Load Balancing > Doc > Using URL maps

CloudFront endpoint just change the url to load balancer end point

I am setting up Amazon CloudFront where the origin is a Load Balancer.
I have able to set CloudFront but their one issue I am facing is that when I access CloudFront endpoint it just change the url to load balancer end point.
I have even whitelist (host) in Cache Behavior. When I whitelist only host then end point of CloudFront did not work. Means not able to access the web application which in ELB.
When I whitelist the three header (origin, Referer, & host) then also not able to access the web application from web browser.
Last I try that I just whitelist (origin, Referer) then able to access the web site. But it just change the url and show the end point if ELB.
Can anyone help me to this?

Two different AWS applications on the same domain with a different subfolders

Based on this issue CAS server cross subdomain ST ticket I'm thinking about changing of my applications urls.
I have two applications on the following subdomains
https://ui.example.com - static AngularJS application(JavaScript, HTML) hosted on Amazon S3
https://api.example.com - Java Spring application hosted on Amazon EC2 instances (for Tomcat) with Elastic Load Balancing that distributes incoming application traffic across multiple Amazon EC2.
Right now I need to change urls of my applications to the following:
https://ui.example.com
https://ui.example.com/api
In other words I need to make api.example.com application available as /api subfolder of my ui.example.com domain.
How it can be configured with AWS ? Where at AWS I need to make an appropriate changes and configuration ?
You could setup an Nginx proxy in front of both servers, mapping the root path to S3 and the /api path to your EC2 instance. Or you could set up a CloudFront distribution (or use another CDN like CloudFlare) and map the different paths to different origin servers.
In general you have to put a proxy in front of all the servers sharing a domain name.