# HG changeset patch # User Igor Sysoev # Date 1120833260 0 # Node ID 7fa11e5c6e9612ecff5eb58274cc846ae742d1d2 # Parent e31ce4d8b8e64cb5165fcfdc7022ddd2451ed066 nginx-0.1.38-RELEASE import *) Feature: the "limit_rate" directive is supported in in proxy and FastCGI mode. *) Feature: the "X-Accel-Limit-Rate" response header line is supported in proxy and FastCGI mode. *) Feature: the "break" directive. *) Feature: the "log_not_found" directive. *) Bugfix: the response status code was not changed when request was redirected by the ""X-Accel-Redirect" header line. *) Bugfix: the variables set by the "set" directive could not be used in SSI. *) Bugfix: the segmentation fault may occurred if the SSI page has more than one remote subrequest. *) Bugfix: nginx treated the backend response as invalid if the status line in the header was transferred in two packets; the bug had appeared in 0.1.29. *) Feature: the "ssi_types" directive. *) Feature: the "autoindex_exact_size" directive. *) Bugfix: the ngx_http_autoindex_module did not support the long file names in UTF-8. *) Feature: the IMAP/POP3 proxy. diff --git a/conf/nginx.conf b/conf/nginx.conf --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -37,7 +37,7 @@ http { # deny access to .htaccess files # - #location ~ \.ht { + #location ~ /\.ht { # deny all; #} } diff --git a/docs/xml/nginx/changes.xml b/docs/xml/nginx/changes.xml --- a/docs/xml/nginx/changes.xml +++ b/docs/xml/nginx/changes.xml @@ -9,6 +9,129 @@ nginx changelog + + + + +директива limit_rate поддерживается в режиме прокси и FastCGI. + + +the "limit_rate" directive is supported in in proxy and FastCGI mode. + + + + + +в режиме прокси и FastCGI поддерживается строка заголовка "X-Accel-Limit-Rate" +в ответе бэкенда. + + +the "X-Accel-Limit-Rate" response header line is supported in proxy and FastCGI +mode. + + + + + +директива break. + + +the "break" directive. + + + + + +директива log_not_found. + + +the "log_not_found" directive. + + + + + +при перенаправлении запроса с помощью строки заголовка "X-Accel-Redirect" +не изменялся код ответа. + + +the response status code was not changed when request was redirected +by the ""X-Accel-Redirect" header line. + + + + + +переменные, установленные директивой set не могли использоваться в SSI. + + +the variables set by the "set" directive could not be used in SSI. + + + + + +при включении в SSI более одного удалённого подзапроса +мог произойти segmentation fault. + + +the segmentation fault may occurred if the SSI page has more than one +remote subrequest. + + + + + +если статусная строка в ответе бэкенда передавалась в двух пакетах, то +nginx считал ответ неверным; +ошибка появилась в 0.1.29. + + +nginx treated the backend response as invalid if the status line in the +header was transferred in two packets; +bug appeared in 0.1.29. + + + + + +директива ssi_types. + + +the "ssi_types" directive. + + + + + +директива autoindex_exact_size. + + +the "autoindex_exact_size" directive. + + + + + +модуль ngx_http_autoindex_module не поддерживал длинные имена файлов в UTF-8. + + +the ngx_http_autoindex_module did not support the long file names in UTF-8. + + + + + +IMAP/POP3 прокси. + + +the IMAP/POP3 proxy. + + + + + + @@ -316,7 +439,7 @@ expressions. -в режиме прокси и FastCGI поддерживается строка заголовка X-Accel-Redirect +в режиме прокси и FastCGI поддерживается строка заголовка "X-Accel-Redirect" в ответе бэкенда. diff --git a/src/core/nginx.h b/src/core/nginx.h --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.1.37" +#define NGINX_VER "nginx/0.1.38" #define NGINX_VAR "NGINX" #define NGX_NEWPID_EXT ".newbin" diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -128,6 +128,7 @@ struct ngx_connection_s { unsigned single_connection:1; unsigned unexpected_eof:1; unsigned timedout:1; + unsigned closed:1; unsigned sendfile:1; unsigned sndlowat:1; diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c --- a/src/core/ngx_palloc.c +++ b/src/core/ngx_palloc.c @@ -15,7 +15,7 @@ ngx_create_pool(size_t size, ngx_log_t * p = ngx_alloc(size, log); if (p == NULL) { - return NULL; + return NULL; } p->last = (u_char *) p + sizeof(ngx_pool_t); diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -753,20 +753,62 @@ ngx_utf_length(ngx_str_t *utf) continue; } - if (c < 0xC0) { - /* invalid utf */ - return utf->len; + if (c >= 0xc0) { + for (c <<= 1; c & 0x80; c <<= 1) { + i++; + } + + continue; } - for (c <<= 1; c & 0x80; c <<= 1) { - i++; - } + /* invalid utf */ + + return utf->len; } return len; } +u_char * +ngx_utf_cpystrn(u_char *dst, u_char *src, size_t n) +{ + u_char c; + + if (n == 0) { + return dst; + } + + for ( /* void */ ; --n; dst++, src++) { + + c = *src; + *dst = c; + + if (c < 0x80) { + if (*dst != '\0') { + continue; + } + + return dst; + } + + if (c >= 0xc0) { + for (c <<= 1; c & 0x80; c <<= 1) { + *++dst = *++src; + } + + continue; + } + + /* invalid utf */ + } + + *dst = '\0'; + + return dst; +} + + uintptr_t ngx_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type) { diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h --- a/src/core/ngx_string.h +++ b/src/core/ngx_string.h @@ -97,6 +97,8 @@ void ngx_encode_base64(ngx_str_t *dst, n ngx_int_t ngx_decode_base64(ngx_str_t *dst, ngx_str_t *src); size_t ngx_utf_length(ngx_str_t *utf); +u_char * ngx_utf_cpystrn(u_char *dst, u_char *src, size_t n); + #define NGX_ESCAPE_URI 0 #define NGX_ESCAPE_ARGS 1 diff --git a/src/event/modules/ngx_rtsig_module.c b/src/event/modules/ngx_rtsig_module.c --- a/src/event/modules/ngx_rtsig_module.c +++ b/src/event/modules/ngx_rtsig_module.c @@ -761,7 +761,7 @@ ngx_rtsig_process_overflow(ngx_cycle_t * } } - ngx_log_error(NGX_LOG_INFO, cycle->log, 0, + ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "rt signal queue overflow recovered"); overflow = 0; diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c --- a/src/event/ngx_event_pipe.c +++ b/src/event/ngx_event_pipe.c @@ -182,7 +182,8 @@ static ngx_int_t ngx_event_pipe_read_ups } else if (!p->cachable && p->downstream->data == p->output_ctx - && p->downstream->write->ready) + && p->downstream->write->ready + && !p->downstream->write->delayed) { /* * if the bufs are not needed to be saved in a cache and @@ -461,7 +462,8 @@ static ngx_int_t ngx_event_pipe_write_to } if (p->downstream->data != p->output_ctx - || !p->downstream->write->ready) + || !p->downstream->write->ready + || p->downstream->write->delayed) { break; } diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c --- a/src/http/modules/ngx_http_autoindex_module.c +++ b/src/http/modules/ngx_http_autoindex_module.c @@ -35,6 +35,7 @@ typedef struct { typedef struct { ngx_flag_t enable; ngx_flag_t localtime; + ngx_flag_t exact_size; } ngx_http_autoindex_loc_conf_t; @@ -67,6 +68,13 @@ static ngx_command_t ngx_http_autoindex offsetof(ngx_http_autoindex_loc_conf_t, localtime), NULL }, + { ngx_string("autoindex_exact_size"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, + ngx_conf_set_flag_slot, + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_autoindex_loc_conf_t, exact_size), + NULL }, + ngx_null_command }; @@ -117,10 +125,11 @@ static u_char tail[] = static ngx_int_t ngx_http_autoindex_handler(ngx_http_request_t *r) { - u_char *last; - size_t len; + u_char *last, scale; + off_t length; + size_t len, copy; ngx_tm_t tm; - ngx_int_t rc; + ngx_int_t rc, size; ngx_uint_t i, level; ngx_err_t err; ngx_buf_t *b; @@ -351,7 +360,7 @@ ngx_http_autoindex_handler(ngx_http_requ + NGX_HTTP_AUTOINDEX_NAME_LEN + sizeof(">") - 2 + sizeof("") - 1 + sizeof(" 28-Sep-1970 12:00 ") - 1 - + 19 + + 20 + 2; } @@ -396,14 +405,27 @@ ngx_http_autoindex_handler(ngx_http_requ *b->last++ = '"'; *b->last++ = '>'; - b->last = ngx_cpystrn(b->last, entry[i].name.data, - NGX_HTTP_AUTOINDEX_NAME_LEN + 1); - len = entry[i].utf_len; + if (len) { + if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) { + copy = NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1; + + } else { + copy = NGX_HTTP_AUTOINDEX_NAME_LEN + 1; + } + + b->last = ngx_utf_cpystrn(b->last, entry[i].name.data, copy); + last = b->last; + + } else { + b->last = ngx_cpystrn(b->last, entry[i].name.data, + NGX_HTTP_AUTOINDEX_NAME_LEN + 1); + last = b->last - 3; + } + if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) { - b->last = ngx_cpymem(b->last - 3, "..>", - sizeof("..>") - 1); + b->last = ngx_cpymem(last, "..>", sizeof("..>") - 1); } else { if (entry[i].dir && NGX_HTTP_AUTOINDEX_NAME_LEN - len > 0) { @@ -427,12 +449,55 @@ ngx_http_autoindex_handler(ngx_http_requ tm.ngx_tm_hour, tm.ngx_tm_min); - if (entry[i].dir) { - b->last = ngx_cpymem(b->last, " -", - sizeof(" -") - 1); + if (alcf->exact_size) { + if (entry[i].dir) { + b->last = ngx_cpymem(b->last, " -", + sizeof(" -") - 1); + } else { + b->last = ngx_sprintf(b->last, "%19O", entry[i].size); + } } else { - b->last = ngx_sprintf(b->last, "%19O", entry[i].size); + if (entry[i].dir) { + b->last = ngx_cpymem(b->last, " -", sizeof(" -") - 1); + + } else { + length = entry[i].size; + + if (length > 1024 * 1024 * 1024 - 1) { + size = (ngx_int_t) (length / (1024 * 1024 * 1024)); + if ((length % (1024 * 1024 * 1024)) + > (1024 * 1024 * 1024 / 2 - 1)) + { + size++; + } + scale = 'G'; + + } else if (length > 1024 * 1024 - 1) { + size = (ngx_int_t) (length / (1024 * 1024)); + if ((length % (1024 * 1024)) > (1024 * 1024 / 2 - 1)) { + size++; + } + scale = 'M'; + + } else if (length > 9999) { + size = (ngx_int_t) (length / 1024); + if (length % 1024 > 511) { + size++; + } + scale = 'K'; + + } else { + size = (ngx_int_t) length; + scale = ' '; + } + + b->last = ngx_sprintf(b->last, "%6i", size); + + if (scale != ' ') { + *b->last++ = scale; + } + } } *b->last++ = CR; @@ -559,6 +624,7 @@ ngx_http_autoindex_create_loc_conf(ngx_c conf->enable = NGX_CONF_UNSET; conf->localtime = NGX_CONF_UNSET; + conf->exact_size = NGX_CONF_UNSET; return conf; } @@ -572,6 +638,7 @@ ngx_http_autoindex_merge_loc_conf(ngx_co ngx_conf_merge_value(conf->enable, prev->enable, 0); ngx_conf_merge_value(conf->localtime, prev->localtime, 0); + ngx_conf_merge_value(conf->exact_size, prev->exact_size, 1); return NGX_CONF_OK; } diff --git a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c --- a/src/http/modules/ngx_http_gzip_filter_module.c +++ b/src/http/modules/ngx_http_gzip_filter_module.c @@ -15,7 +15,7 @@ typedef struct { ngx_flag_t enable; ngx_flag_t no_buffer; - ngx_array_t *types; /* array of ngx_http_gzip_type_t */ + ngx_array_t *types; /* array of ngx_str_t */ ngx_bufs_t bufs; @@ -29,12 +29,6 @@ typedef struct { } ngx_http_gzip_conf_t; -typedef struct { - ngx_str_t name; - ngx_uint_t enable; -} ngx_http_gzip_type_t; - - #define NGX_HTTP_GZIP_PROXIED_OFF 0x0002 #define NGX_HTTP_GZIP_PROXIED_EXPIRED 0x0004 #define NGX_HTTP_GZIP_PROXIED_NO_CACHE 0x0008 @@ -91,20 +85,18 @@ static ngx_int_t ngx_http_gzip_filter_in static void *ngx_http_gzip_create_conf(ngx_conf_t *cf); static char *ngx_http_gzip_merge_conf(ngx_conf_t *cf, void *parent, void *child); -static char *ngx_http_gzip_set_types(ngx_conf_t *cf, ngx_command_t *cmd, +static char *ngx_http_gzip_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -static char *ngx_http_gzip_set_window(ngx_conf_t *cf, void *post, void *data); -static char *ngx_http_gzip_set_hash(ngx_conf_t *cf, void *post, void *data); +static char *ngx_http_gzip_window(ngx_conf_t *cf, void *post, void *data); +static char *ngx_http_gzip_hash(ngx_conf_t *cf, void *post, void *data); static ngx_conf_num_bounds_t ngx_http_gzip_comp_level_bounds = { ngx_conf_check_num_bounds, 1, 9 }; -static ngx_conf_post_handler_pt ngx_http_gzip_set_window_p = - ngx_http_gzip_set_window; -static ngx_conf_post_handler_pt ngx_http_gzip_set_hash_p = - ngx_http_gzip_set_hash; +static ngx_conf_post_handler_pt ngx_http_gzip_window_p = ngx_http_gzip_window; +static ngx_conf_post_handler_pt ngx_http_gzip_hash_p = ngx_http_gzip_hash; @@ -148,7 +140,7 @@ static ngx_command_t ngx_http_gzip_filt { ngx_string("gzip_types"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_gzip_set_types, + ngx_http_gzip_types, NGX_HTTP_LOC_CONF_OFFSET, 0, NULL }, @@ -165,14 +157,14 @@ static ngx_command_t ngx_http_gzip_filt ngx_conf_set_size_slot, NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_gzip_conf_t, wbits), - &ngx_http_gzip_set_window_p }, + &ngx_http_gzip_window_p }, { ngx_string("gzip_hash"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_conf_set_size_slot, NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_gzip_conf_t, memlevel), - &ngx_http_gzip_set_hash_p }, + &ngx_http_gzip_hash_p }, { ngx_string("gzip_no_buffer"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, @@ -270,10 +262,10 @@ static ngx_http_output_body_filter_pt static ngx_int_t ngx_http_gzip_header_filter(ngx_http_request_t *r) { - ngx_uint_t i, found; + ngx_str_t *type; + ngx_uint_t i; ngx_http_gzip_ctx_t *ctx; ngx_http_gzip_conf_t *conf; - ngx_http_gzip_type_t *type; conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module); @@ -297,24 +289,21 @@ ngx_http_gzip_header_filter(ngx_http_req } - found = 0; type = conf->types->elts; - for (i = 0; i < conf->types->nelts; i++) { - if (r->headers_out.content_type.len >= type[i].name.len + if (r->headers_out.content_type.len >= type[i].len && ngx_strncasecmp(r->headers_out.content_type.data, - type[i].name.data, type[i].name.len) == 0) + type[i].data, type[i].len) == 0) { - found = 1; - break; + goto found; } } - if (!found) { - return ngx_http_next_header_filter(r); - } + return ngx_http_next_header_filter(r); +found: + if (r->headers_in.via) { if (conf->proxied & NGX_HTTP_GZIP_PROXIED_OFF) { return ngx_http_next_header_filter(r); @@ -1031,7 +1020,7 @@ ngx_http_gzip_merge_conf(ngx_conf_t *cf, ngx_http_gzip_conf_t *prev = parent; ngx_http_gzip_conf_t *conf = child; - ngx_http_gzip_type_t *type; + ngx_str_t *type; ngx_conf_merge_value(conf->enable, prev->enable, 0); @@ -1051,8 +1040,7 @@ ngx_http_gzip_merge_conf(ngx_conf_t *cf, if (conf->types == NULL) { if (prev->types == NULL) { - conf->types = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_gzip_type_t)); + conf->types = ngx_array_create(cf->pool, 1, sizeof(ngx_str_t)); if (conf->types == NULL) { return NGX_CONF_ERROR; } @@ -1062,9 +1050,8 @@ ngx_http_gzip_merge_conf(ngx_conf_t *cf, return NGX_CONF_ERROR; } - type->name.len = sizeof("text/html") - 1; - type->name.data = (u_char *) "text/html"; - type->enable = 1; + type->len = sizeof("text/html") - 1; + type->data = (u_char *) "text/html"; } else { conf->types = prev->types; @@ -1076,17 +1063,15 @@ ngx_http_gzip_merge_conf(ngx_conf_t *cf, static char * -ngx_http_gzip_set_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +ngx_http_gzip_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { ngx_http_gzip_conf_t *gcf = conf; - ngx_str_t *value; - ngx_uint_t i; - ngx_http_gzip_type_t *type; + ngx_str_t *value, *type; + ngx_uint_t i; if (gcf->types == NULL) { - gcf->types = ngx_array_create(cf->pool, 4, - sizeof(ngx_http_gzip_type_t)); + gcf->types = ngx_array_create(cf->pool, 4, sizeof(ngx_str_t)); if (gcf->types == NULL) { return NGX_CONF_ERROR; } @@ -1096,9 +1081,8 @@ ngx_http_gzip_set_types(ngx_conf_t *cf, return NGX_CONF_ERROR; } - type->name.len = sizeof("text/html") - 1; - type->name.data = (u_char *) "text/html"; - type->enable = 1; + type->len = sizeof("text/html") - 1; + type->data = (u_char *) "text/html"; } value = cf->args->elts; @@ -1114,14 +1098,14 @@ ngx_http_gzip_set_types(ngx_conf_t *cf, return NGX_CONF_ERROR; } - type->name.len = value[i].len; + type->len = value[i].len; - type->name.data = ngx_palloc(cf->pool, type->name.len + 1); - if (type->name.data == NULL) { + type->data = ngx_palloc(cf->pool, type->len + 1); + if (type->data == NULL) { return NGX_CONF_ERROR; } - ngx_cpystrn(type->name.data, value[i].data, type->name.len + 1); + ngx_cpystrn(type->data, value[i].data, type->len + 1); } return NGX_CONF_OK; @@ -1129,7 +1113,7 @@ ngx_http_gzip_set_types(ngx_conf_t *cf, static char * -ngx_http_gzip_set_window(ngx_conf_t *cf, void *post, void *data) +ngx_http_gzip_window(ngx_conf_t *cf, void *post, void *data) { int *np = data; @@ -1153,7 +1137,7 @@ ngx_http_gzip_set_window(ngx_conf_t *cf, static char * -ngx_http_gzip_set_hash(ngx_conf_t *cf, void *post, void *data) +ngx_http_gzip_hash(ngx_conf_t *cf, void *post, void *data) { int *np = data; diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -914,7 +914,7 @@ ngx_http_proxy_parse_status_line(ngx_htt } break; - /* end of request line */ + /* end of status line */ case sw_almost_done: p->status_end = pos - 1; switch (ch) { @@ -926,7 +926,7 @@ ngx_http_proxy_parse_status_line(ngx_htt } } - u->header_in.pos = pos + 1; + u->header_in.pos = pos; r->state = state; return NGX_AGAIN; @@ -1803,7 +1803,7 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_ } for (i = 0; i < plcf->peers->number; i++) { - plcf->peers->peer[i].uri_separator = ":"; + plcf->peers->peer[i].uri_separator = ""; } plcf->host_header = inet_upstream.host_header; diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -36,6 +36,8 @@ static ngx_int_t ngx_http_rewrite_init(n static char *ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char *ngx_http_rewrite_return(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); +static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, + void *conf); static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf, @@ -66,6 +68,14 @@ static ngx_command_t ngx_http_rewrite_c 0, NULL }, + { ngx_string("break"), + NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF + |NGX_CONF_NOARGS, + ngx_http_rewrite_break, + NGX_HTTP_LOC_CONF_OFFSET, + 0, + NULL }, + { ngx_string("if"), NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_1MORE, ngx_http_rewrite_if, @@ -601,6 +611,24 @@ ngx_http_rewrite_return(ngx_conf_t *cf, static char * +ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +{ + ngx_http_rewrite_loc_conf_t *lcf = conf; + + ngx_http_script_code_pt *code; + + code = ngx_http_script_start_code(cf->pool, &lcf->codes, sizeof(uintptr_t)); + if (code == NULL) { + return NGX_CONF_ERROR; + } + + *code = ngx_http_script_break_code; + + return NGX_CONF_OK; +} + + +static char * ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { ngx_http_rewrite_loc_conf_t *lcf = conf; diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -24,6 +24,8 @@ typedef struct { ngx_flag_t silent_errors; ngx_flag_t ignore_recycled_buffers; + ngx_array_t *types; /* array of ngx_str_t */ + size_t min_file_chunk; size_t value_len; } ngx_http_ssi_conf_t; @@ -127,6 +129,8 @@ static ngx_int_t ngx_http_ssi_endif(ngx_ static ngx_http_variable_value_t * ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r, uintptr_t gmt); +static char *ngx_http_ssi_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); + static ngx_int_t ngx_http_ssi_add_variables(ngx_conf_t *cf); static void *ngx_http_ssi_create_conf(ngx_conf_t *cf); static char *ngx_http_ssi_merge_conf(ngx_conf_t *cf, @@ -164,6 +168,13 @@ static ngx_command_t ngx_http_ssi_filte offsetof(ngx_http_ssi_conf_t, min_file_chunk), NULL }, + { ngx_string("ssi_types"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, + ngx_http_ssi_types, + NGX_HTTP_LOC_CONF_OFFSET, + 0, + NULL }, + ngx_null_command }; @@ -201,7 +212,7 @@ static ngx_int_t (*ngx_http_next_body_fi static u_char ngx_http_ssi_string[] = "