Answer the question
In order to leave comments, you need to log in
How can nginx redirect a request based on JSON content?
NGINX accepts POST requests containing small JSON. Depending on the values of the two fields, requests must be redirected to one or the other upstream.
For example, POST requests come with a body like or . You need to send those from A to , and those from B - to
How can this be done by NGINX, without running third-party php scripts?
It seems that you can somehow use Lua scripts, but I have never come across this. {"type":"A","data":{...
{"type":"B","data":{...
https://hostA.domain.tld
https://hostB.domain.tld
Answer the question
In order to leave comments, you need to log in
https://github.com/calio/form-input-nginx-module
but more flexible to write in lua
No. Nginx does not parse the request BODY. Pass type as a post parameter from the front.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question