Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to get the users country via CDN header?

Avatar

Level 9

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

 

 

 

 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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-delive...

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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-delive...

Avatar

Level 9
This doesnt seem to work for us, see updated question above.