Welcome! Log In Create A New Profile

Advanced

Re: Parse response body and return status code/body based on it

Francis Daly
October 02, 2016 06:20AM
On Sat, Oct 01, 2016 at 07:08:44PM -0400, spacerobot wrote:

Hi there,

> I'm trying to achieve an mechanism that for requests to certain endpoints,
> nginx makes a HTTP call to a certain server (mostly POST and DELETE), gets a
> response back, parse the response code and body, and based on the response
> code and the content of the response body, return certain HTTP status
> codes/response to the caller. Is there an existing module that can help
> achieve this?

That sounds like you want a very specific set of things to happen. It is
unlikely that that exact set of things is already in a dedicated module.

I suspect that you will find it easiest to start by using one of the
embedded-language modules and writing your logic in that language -- lua,
perl, and a version of javascript are available; probably more are too.

(If there are specific things that you need, such as issuing a http
DELETE to another url, you will want to confirm that the facility to do
that is available in the language that you choose to use.)

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Parse response body and return status code/body based on it

spacerobot October 01, 2016 07:08PM

Re: Parse response body and return status code/body based on it

Francis Daly October 02, 2016 06:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready