Permanent structure to accumulate data
serg.brester at sebres.de
Fri Feb 9 16:57:11 UTC 2018
Unfortunately, the question is ambiguous.
You can put it into the structure, you initialized `mycf =
where cf is `ngx_conf_t *cf`, if you want to save it per location.
Then you can get it in the handler, using `mycf =
There are many another places, where you can put it.
E. g. just as static variable like `static int var`, so valid per
But you should provide more info what exactly you want do.
For example another issue may be also multiple-workers at all (that are
processes, not the threads in nginx), so
if it should be exactly one counter across all workers, then you should
put it into the shared memory (or somewhere in shared pools, using
ngx_slab_alloc functions). The good example would be own nginx module
Because otherwise, each worker will just get its own counter.
Am 09.02.2018 17:31, schrieb Antonio Nappa:
> I am looking for a structure that I can use to store a counter in the module, this structure should not be reset every time there is a new request.
> I have made tests with the module custom ctx and the module custom srv configuration without success, which means every time there is a new request the field becomes zero.
> Thanks, Antonio
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel 
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx-devel