Hi Folks,
I'd like to use OpenResty as "Front-end proxy" (a.k.a forward proxy) for my applications who consumes 3rd party SOAP/REST API so I can record the full outgoing requests/responses associated with some computed metrics for audit/troubleshooting purposes.
My first option would be to have use a content_by_lua block using an resty.http client to forward the incoming http request to the external service and doing the log+metric computations on this lua handler.
This approach however makes me feel that I'm reinventing the wheel given that nginx/openresty can be used as basic forward proxy, but I couldn't figure out how to intercept the req/res so I can compute the metrics and log the req/res HTTP headers & body.
What you guys recommend? should I pursue the first strategy or is it possible to use the second one?
Thanks in advance for any input and directions.
Regards,
Eric.