Hi All, I am trying to collect the POST request body using $request_body but I am unable to collect it in config file:
# curl -X POST -d "param1=value1¶m2=value2" ' http://localhost:8031/test1/test2/' --header "Content-Type:application/json" location /test1 { ........................... if ( $request_body ~ (.*?)(=)(.*?)(&)(.*?)(=)(.*) ) { echo $1; echo $2; echo $3; } } But when I tried to use the nginx-echo module, I was able to print it but I couldn't use it in if(). location /test1 { ........................... echo_read_request_body; echo $request_body; set $foo $echo_request_body; echo $foo; if ( $foo ~ (.*?)(=)(.*?)(&)(.*?)(=)(.*) ) { echo $1; echo $2; echo $3; } } #curl -X POST -d "param1=value1¶m2=value2" ' http://localhost:8031/test1/test2/' --header "Content-Type:application/json" param1=value1¶m2=value2 foo value is not getting echoed out. So the condition is not entering if(). Actually I intention is to load balance according to data in POST request. Thanks Eswar
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx