Open Laski opened 9 months ago
I'm trying to combine the "dynamic_mock" and "proxy" resources. My objective is to route the requests wherever the HOST header says.
e.g.
request: method: GET path: /example dynamic_response: engine: lua script: |- require "math" return { proxy = { host = ..request.headers.host, follow_redirects = true } }
or
request: method: GET path: /example dynamic_response: engine: go_template_yaml script: | proxy: host: {{.Request.Headers.Get "Host"}} follow_redirect: true
neither of this seem to work (the response is actually 200 but empty).
Maybe I should note that hardcoding the host part doesn't seem to work either.
host
Is this a supported use case?
Hi @Laski,
dynamic_responses only allow to generate a response, not a proxy.
dynamic_response
response
proxy
There's no real way to handle "dynamic proxy" for now.
I'm trying to combine the "dynamic_mock" and "proxy" resources. My objective is to route the requests wherever the HOST header says.
e.g.
or
neither of this seem to work (the response is actually 200 but empty).
Maybe I should note that hardcoding the
host
part doesn't seem to work either.Is this a supported use case?