Re: Parse JSON POST request into nginx variable

2015-03-27 Thread datanasov
justink101 Wrote: --- > How can I read a POST request body which is JSON and get a property? > I need to read a property and use it as a variable in proxy_pass. > > Pseudo code: > >$post_request_body = '{"account": "test.mydomain.com", > "m

Re: Parse JSON POST request into nginx variable

2014-06-14 Thread Robert Paprocki
There is a form input module you can use to parse POST body into a variable: https://github.com/calio/form-input-nginx-module However this will not get JSON data. For this you make want to look into leveraging the nxin Lua module in conjunction with the Lua cjson module: http://wiki.nginx.org/Ht

Parse JSON POST request into nginx variable

2014-06-14 Thread justink101
How can I read a POST request body which is JSON and get a property? I need to read a property and use it as a variable in proxy_pass. Pseudo code: $post_request_body = '{"account": "test.mydomain.com", "more-stuff": "here"}'; // I want to get $account = "test.mydomain.com"; proxy_pa