How to get the users country via CDN header? | Community
Skip to main content
Level 8
June 28, 2021
Solved

How to get the users country via CDN header?

  • June 28, 2021
  • 1 reply
  • 1387 views

with Episerver cloud, the backend code simply reads the clients country code from the CF-IPCountry header which cloudflare puts on to each request automatically. 

 

What do you get with AEM cloud?  it has flastly, which i understand has similar functionality to cloudflare?

 

Basically, we need block/route requests based on which country they are from, and do logic in our AEM app.

 

We wrote a simple servlet to dump the headers, deployed it to the cloud env, and then when we hit the servlet we dont see the x-aem-client-country header.  to fix we need to add it to clientheaders.any

 

 

 

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ritesh_Mittal

Hi @tb3dock ,

 

we have something called x-aem-client-country which you can get from request header for this.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delivery/cdn.html?lang=en

1 reply

Ritesh_Mittal
Community Advisor and Adobe Champion
Ritesh_MittalCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 28, 2021

Hi @tb3dock ,

 

we have something called x-aem-client-country which you can get from request header for this.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delivery/cdn.html?lang=en

TB3dockAuthor
Level 8
July 5, 2021
This doesnt seem to work for us, see updated question above.