How to get the users country via CDN header? | Community
Skip to main content
Level 8
Jun 28, 2021 1:42 PM UTC
Solved

How to get the users country via CDN header?

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.
Ritesh_Mittal
Ritesh_MittalAccepted solution
New Participant
Jun 28, 2021 2:49 PM UTC

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

2 replies

Ritesh_Mittal
Ritesh_MittalAccepted solution
New Participant
Jun 28, 2021 2:49 PM UTC

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

Translate
TB3dockAuthor
Level 8
Jul 5, 2021 10:20 AM UTC
This doesnt seem to work for us, see updated question above.
Translate