Skip to content

Instantly share code, notes, and snippets.

@sjparkinson
Last active September 5, 2017 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjparkinson/73e32737c463e5ac42af6d881a7d1442 to your computer and use it in GitHub Desktop.
Save sjparkinson/73e32737c463e5ac42af6d881a7d1442 to your computer and use it in GitHub Desktop.
condition {
name = "request_is_us"
statement = "req.http.X-Geoip-Continent ~ \"(NA|SA|OC|AS)\" || (!F_eu_origin.healthy && F_us_origin.healthy)"
type = "REQUEST"
priority = 100
}
condition {
name = "request_is_eu"
statement = "req.http.X-Geoip-Continent !~ \"(NA|SA|OC|AS)\" || (!F_us_origin.healthy && F_eu_origin.healthy)"
type = "REQUEST"
priority = 100
}
backend {
name = "us_origin"
request_condition = "request_is_us"
healthcheck = "us_healthcheck"
}
backend {
name = "eu_origin"
request_condition = "request_is_eu"
healthcheck = "eu_healthcheck"
}
healthcheck {
name = "eu_healthcheck"
host = "example-eu-app.herokuapp.com"
path = "/__gtg"
}
healthcheck {
name = "us_healthcheck"
host = "example-us-app.herokuapp.com"
path = "/__gtg"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment