Geolocation Header through Cloudflare with Transform Rules

I am looking at the transform rules in Cloudflare and can I add a header for geolocation and what would that look like? With Cloudfront, I did see an example, but I couldn’t find anything for CF.

Any assistance is always appreciated.

You don’t need a transform rule to add a geolocation header.

https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-Cloudflare-IP-Geolocation

1 Like

Ok, and thank you for the reply. I was actually speaking of the origin response headers and not the visitor headers.

Now I’m not sure what you’re looking for. You want Cloudflare to add a response header to let the visitor know where they’re located?

No, I was hoping to add a response header to let them know my company’s exact location . Maybe I am barking up the wrong tree, but I was looking for something like this:

That’s a request header that contains your visitor’s location that’s sent to your server.

I’m really not sure what this has to do with your company’s exact location.

Quote on the Amazon page:
“You can use these additional geolocation headers along with the existing supported CloudFront headers to personalize the content that you deliver to your viewers.”

Maybe I am going down the wrong path, but it looks like you can personalize the response headers and provide more information about your company. Maybe I misunderstood.

That’s correct:

Amazon or Cloudflare sends geolocation info to your server, and it’s up to you to take that info and customize the content of your site. Cloudflare can assist with something like this, but other site developers may have that feature built in on their site:

https://developers.cloudflare.com/workers/examples/country-code-redirect

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.