Using body content to generate a correct response
guido.accardo at usmediaconsulting.com
Tue Jan 7 17:20:41 UTC 2014
I'm using Nginx to serve applications of Real Time Bidding listening in
different machines inside of my network. Each one of these applications is
handling request from only one exchange and I'm successfully proxying the
content to the correct applications by using upstreams.
One thing that I'm doing when I need to do some modifications in one o more
of these applications is use "return 204" (for RTB system using OpenRTB
protocl, HTTP 204 means NO BID) to not forward content. This was working
great until now that my employer has decided to include another exchange,
in consequence, another application. The new exchange is not OpenRTB based,
it uses another protocol to answer, and of course no bid response is
In order to correctly answer with no bid I have to parse XML content which
is inside of the request sent by the exchange. This is the form of the
response I have to send:
OppId, advId, buyerLine, bidResEnv signature are items that comes with the
As you can see I have 2 challenges here:
* Parse XML body content with Nginx
* Manipulate It to generate the correct answer
Do I need to develop a Nginx plugin or there is a simpler way to parse the
body content and use it to answer?
I know that Nginx can use headers from the request in the response, so I
presume that something with the body could also done.
Thank you, cheers,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx-devel