How to send an HTTP request to external service in the APISIX Gateway serverless-pre-function, I am trying below but getting an error
"serverless-pre-function": {
"disable": false,
"functions": [
"return function() ngx.location.capture(\"http://host.docker.internal:9191/health\"); ngx.log(ngx.ERR, \"serverless pre function\"); end"
],
"phase": "before_proxy"
}
2022/09/13 14:50:20 [error] 49#49: *19282359 open() "/usr/local/apisix/htmlhttp://host.docker.internal:9191/health" failed (2: No such file or directory), client: 172.18.0.1, server: _, request: "GET /dbt/actuator/health HTTP/1.1", subrequest: "http://host.docker.internal:9191/health", host: "127.0.0.1:9080"
Once the external service is called, the pre-function function continue by executing the original request.