# HG changeset patch # User Igor Sysoev # Date 1175164044 0 # Node ID b8fe8a80e0196c801ef8c19a3212c27f059bc07c # Parent 3a95870b3229336296c8c40bfb8afdcb0697b483 the "include" support inside the "types" directive diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1898,16 +1898,29 @@ ngx_http_core_type(ngx_conf_t *cf, ngx_c { ngx_http_core_loc_conf_t *lcf = conf; - ngx_str_t *value, *content_type, *old; + ngx_str_t *value, *content_type, *old, file; ngx_uint_t i, n; ngx_hash_key_t *type; + value = cf->args->elts; + + if (ngx_strcmp(value[0].data, "include") == 0) { + file = value[1]; + + if (ngx_conf_full_name(cf->cycle, &file) == NGX_ERROR){ + return NGX_CONF_ERROR; + } + + ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); + + return ngx_conf_parse(cf, &file); + } + content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); if (content_type == NULL) { return NGX_CONF_ERROR; } - value = cf->args->elts; *content_type = value[0]; for (i = 1; i < cf->args->nelts; i++) {