Proxying POST requests for the given conditions

Hi,

For all POST requests to nginx.

We want to proxy_pass to http://192.168.1.1:8000 if test=1 or to
http://192.168.1.2:8080 if test=0

How to configure the above.

Thanks,
M. G.