Taymindis/nginx-link-function

How to get the value of a config file param during cycle init?

tarkin000 opened this issue · 2 comments

Hello,
I looked through the wiki, and had a quick look in the nginx source, but can't quite understand how to get the value of a config file parameter?

location /foo {
  root /custom/path/to/assets;
  ngx_link_func_call "foo";
}

How would I get the value of root during ngx_link_func_init_cycle?

No, I don’t implement for cross module checked, the root directive is from another module. If you want config key value param, please use :-

For init cycle props -> extern u_char* ngx_link_func_cyc_get_prop(ngx_link_func_cycle_t *ctx, const char *key, size_t keylen);

For context session props -> extern u_char* ngx_link_func_get_prop(ngx_link_func_ctx_t *ctx, const char *key, size_t keylen);

References: https://github.com/Taymindis/nginx-link-function/wiki/Tips-and-Tricks#11-use-ngx_link_func_add_prop-directive-for-application-properties-configuration

I understand now, thank you.