On Fri, Oct 06, 2017 at 10:38:54PM +0200, Lucas Rolff wrote: Hi there,
> I do use some of the openresty modules such as the ngx_headers_more > module, and it's pretty explicit about it's inheritance. That's probably a good example to look at. Compare the ngx_http_headers_more_merge_loc_conf() function with ngx_http_headers_merge_conf() (or with pretty much any of the stock nginx equivalents). In the external headers_more module, the decision is taken to "merge" by adding the "parent" directive config to the "child" one. In the internal modules, the decision is (mostly) taken to "merge" by only using the "parent" directive config if the "child" is empty. > And thank you for the pointer regarding the _module_ctx and > _merge_loc_conf functions, it gave me enough information regarding > the http_proxy module as an example - it seem as long as there a > "offsetof(ngx_http_proxy_loc_conf_t" - then it can be inherited, or > it's a coincidence that it's missing the "offsetoff" for all > directives that doesn't inherit in that module from top of my head. It's not so much the "offsetof(", as the fact that in the _merge function, the config struct member that corresponds to this directive is either mentioned (and therefore probably inherits from the parent) or is not (and does not inherit). See how "expires" is handled in src/http/modules/ngx_http_headers_filter_module.c -- it's the first member of the struct and therefore does not need an offsetof() to identify the position. And, as always, the source is the ultimate documentation for how things are. This mail is just "how I think things might have been intended to be". Cheers, f -- Francis Daly fran...@daoine.org _______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx