Skip to content

Instantly share code, notes, and snippets.

@jerzyn
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save jerzyn/9688589 to your computer and use it in GitHub Desktop.

Select an option

Save jerzyn/9688589 to your computer and use it in GitHub Desktop.
Nginx matching the environments plans names
local s = ngx.re.match(res.body,[=[<plan>Sandbox]=])
local p = ngx.re.match(res.body,[=[<plan>Production]=])
if p then
ngx.var.proxy_pass = "http://production_upstream"
elseif s then
ngx.var.proxy_pass = "http://sandbox_upstream"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment