NJS Questions and/or Bugs

Sergey A. Osokin osa at freebsd.org.ru
Thu Aug 12 02:19:53 UTC 2021

Hi Lance,

On Wed, Aug 11, 2021 at 09:05:32PM -0500, Lance Dockins wrote:
> Hi Sergey,
> Thank you.  Perhaps something is going wrong with the implementation
> of r.args that we’re using.  I’m just getting an empty JS object for
> POST vars.  Args only seems to work for query string vars for me.
> Here’s the key config info.
> In the location block for the route that I’m testing:
> add_header Content-Type text/plain;
> js_content dbadmin.access;
> The dbadmin.access function just has this at the top of the function right now:
> r.return(200, JSON.stringify(r.args));

Could you please share a couple of things:

- whole dbadmin.js file;
- a server block from nginx configuration file with a full location

For development and testing I'd recommend to use:
- curl command line utility, i.e. something like:
  % curl -v --data-binary @test.bin\&baz=1

- enable debugging as described at http://nginx.org/en/docs/debugging_log.html
  so you'll be able to see what's going on with a request processing


More information about the nginx mailing list