diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-11-20 19:52:20 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-11-20 19:52:20 +0000 |
commit | d43bee8ee939992404d59ae0fec248ce46abecb0 (patch) | |
tree | 6eb79a6902f147bedb8c85350cbdc68543115907 /src/http/ngx_http_core_module.c | |
parent | 13376e1538e2b29e436805c626f6837b34a482c5 (diff) | |
download | nginx-d43bee8ee939992404d59ae0fec248ce46abecb0.tar.gz nginx-d43bee8ee939992404d59ae0fec248ce46abecb0.zip |
nginx-0.1.8-RELEASE importrelease-0.1.8
*) Bugfix: in the ngx_http_autoindex_module if the long file names were
in the listing.
*) Feature: the "^~" modifier in the location directive.
*) Feature: the proxy_max_temp_file_size directive.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 29a6f76fc..c764b2a00 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -13,7 +13,8 @@ #define NGX_HTTP_LOCATION_EXACT 1 #define NGX_HTTP_LOCATION_AUTO_REDIRECT 2 -#define NGX_HTTP_LOCATION_REGEX 3 +#define NGX_HTTP_LOCATION_NOREGEX 3 +#define NGX_HTTP_LOCATION_REGEX 4 static void ngx_http_phase_event_handler(ngx_event_t *rev); @@ -564,12 +565,13 @@ static ngx_int_t ngx_http_find_location(ngx_http_request_t *r, ngx_array_t *locations, size_t len) { ngx_int_t n, rc; - ngx_uint_t i, found; + ngx_uint_t i, found, noregex; ngx_http_core_loc_conf_t *clcf, **clcfp; ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "find location"); found = 0; + noregex = 0; clcfp = locations->elts; for (i = 0; i < locations->nelts; i++) { @@ -619,6 +621,7 @@ static ngx_int_t ngx_http_find_location(ngx_http_request_t *r, } r->loc_conf = clcfp[i]->loc_conf; + noregex = clcfp[i]->noregex; found = 1; } } @@ -637,6 +640,10 @@ static ngx_int_t ngx_http_find_location(ngx_http_request_t *r, #if (NGX_PCRE) + if (noregex) { + return NGX_HTTP_LOCATION_NOREGEX; + } + /* regex matches */ for (/* void */; i < locations->nelts; i++) { @@ -1069,6 +1076,13 @@ static char *ngx_location_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) clcf->name = value[2]; clcf->exact_match = 1; + } else if (value[1].len == 2 + && value[1].data[0] == '^' + && value[1].data[1] == '~') + { + clcf->name = value[2]; + clcf->noregex = 1; + } else if ((value[1].len == 1 && value[1].data[0] == '~') || (value[1].len == 2 && value[1].data[0] == '~' |