Skip to content

Instantly share code, notes, and snippets.

View simonkuhn's full-sized avatar

Simon Kuhn simonkuhn

  • 13:41 (UTC -07:00)
View GitHub Profile
@simonkuhn
simonkuhn / geo.vcl
Last active January 7, 2022 12:16
Fastly VCL for geoip json output
sub vcl_recv {
#FASTLY recv
# We don't do other methods
if (req.method != "GET") {
return(error);
}
# Handle IPv4 or IPv6 provided in url path (nothing extraneous allowed, perform basic matching)
if (req.url.path ~ "^/([a-f0-9:.]+)$") {
set client.geo.ip_override = re.group.1;

Keybase proof

I hereby claim:

  • I am simonkuhn on github.
  • I am skuhn (https://keybase.io/skuhn) on keybase.
  • I have a public key ASBbfeoK-WTrcXzxHBMnaJTrVT-EvrI_H0jz8CH-Za4NHwo

To claim this, I am signing this object: