nginScript (njs) feedback
jlorgal at gmail.com
Wed Jun 22 18:35:34 UTC 2016
I'm trying to implement a routing logic with nginScript. I haven't been
I would like to give you my feedback just in case it may help to improve
njs (from more important/blocking to less important):
- There is no way to iterate through the keys of an object. It is not
supported none of the following methods:
- for ... in
- I would like to use/import nginx variables. Something like
- I miss string.split function. Probably map, reduce, and many other
methods as well.
- It would be nice to have some "singleton" support where I could set a
variable that is evaluated only once (first time is required or when nginx
is started/reloaded). It's clear that it should not be related to
request/response but this approach would improve performance by avoiding
executing same thing for each request. It would be similar to importing a
are satisfied only once).
"include /etc/nginx/js/*.js;" but this .js files need to include the js_set
- It would be nice to access a cookie by name (it wouldn't be necessary
if I could access to a nginx var like $v.cookie_XXX).
- Logging function would be nice to help debugging.
Hope it can be helpful
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx