Search code examples
amazon-web-servicesdnsamazon-route53

Can we check which region is the request coming in for our site on AWS?


I wanted to know if it is possible to point where is the request coming from mainly the geographical region.

for example on the architecture which follows:

route53 -> LB -> Ec2.

Is it possible or should we do any architectural changes to find out?


Solution

  • One way to obtain geolocation information using AWS services is through CloudFront, which has recently added geolocation headers:

    The new headers give you more granular control of cache behavior and your origin access to the viewer’s country name, region, city, postal code, latitude, and longitude, all based on the viewer’s IP address.

    To use this, you would have to added CloudFront distro to your current architecture:

    Route53 -> CloudFront -> LB -> EC2