aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-03-29 10:27:24 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-03-29 10:27:24 +0000
commiteba03e6bea843b1b74fc04bfa2c941202318aaf8 (patch)
treeec63b5ecdf33accbccdafd741c0911d67c3a669b /src
parent4ca98f65a5b2e753bdbb235d4609fbf3e0e323d6 (diff)
downloadnginx-eba03e6bea843b1b74fc04bfa2c941202318aaf8.tar.gz
nginx-eba03e6bea843b1b74fc04bfa2c941202318aaf8.zip
the "include" support inside the "types" directive
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_core_module.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index e684d111c..4a957d223 100644
--- 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_command_t *dummy, void *conf)
{
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++) {