Skip to content

Instantly share code, notes, and snippets.

@erikcw
Created October 18, 2013 00:56
Show Gist options
  • Save erikcw/7034863 to your computer and use it in GitHub Desktop.
Save erikcw/7034863 to your computer and use it in GitHub Desktop.
local headers = ngx.req.get_headers()
headers['CF_VISITOR'] = ngx.var.x_scheme_json
headers['X-Forwarded-Host'] = ngx.var.host
url = "http://localhost:8888" .. tostring(ngx.var.uri)
local res = ngx.location.capture('/proxy', {
ctx = {
headers = headers
},
vars = {
_url = url
}
})
local body = res.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment