vaibhavsw opened a new issue, #7907:
URL: https://github.com/apache/apisix/issues/7907
### Description
I am trying to configure the `serverless-pre-function` and trying to run it
before the proxy happens to the upstream so that the request body received in
the HTTP Body could be sent to an external app, get transformed, and then get
it forwarded to the upstream proxy, however, it doesn't; seem to be working,
below is the config at the service level.
```JSON
"serverless-pre-function": {
"disable": false,
"functions": [
"return function(conf, ctx) ngx.location.capture(\"/health\"); end"
],
"phase": "before_proxy"
}
```
and below error is thrown again and again
```JSON
2022/09/13 19:05:15 [error] 48#48: *147715 [lua] init.lua:760:
http_balancer_phase(): invalid api_ctx while connecting to upstream, client:
172.18.0.1, server: _, request: "GET /dbt/actuator/health HTTP/1.1",
subrequest: "/health", host: "127.0.0.1:9080"```
Once the response is received from the subrequest, the response of it will
be overridden for the upstream proxy as well.,
### Environment
- APISIX version (run `apisix version`): 2.15
- Operating system (run `uname -a`): MacOS
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`): nginx
version: openresty/1.21.4.1
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`): 3.4.15
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`): 3.8.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]