Mercurial > hg > nginx-vendor-1-0
comparison src/http/ngx_http_log_module.c @ 58:b55cbf18157e NGINX_0_1_29
nginx 0.1.29
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; bug appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 12 May 2005 00:00:00 +0400 |
parents | bcb5fce0b038 |
children | 71c46860eb55 |
comparison
equal
deleted
inserted
replaced
57:5df375c55338 | 58:b55cbf18157e |
---|---|
104 ngx_null_command | 104 ngx_null_command |
105 }; | 105 }; |
106 | 106 |
107 | 107 |
108 ngx_http_module_t ngx_http_log_module_ctx = { | 108 ngx_http_module_t ngx_http_log_module_ctx = { |
109 ngx_http_log_set_formats, /* pre conf */ | 109 ngx_http_log_set_formats, /* preconfiguration */ |
110 NULL, /* postconfiguration */ | |
110 | 111 |
111 ngx_http_log_create_main_conf, /* create main configuration */ | 112 ngx_http_log_create_main_conf, /* create main configuration */ |
112 NULL, /* init main configuration */ | 113 NULL, /* init main configuration */ |
113 | 114 |
114 NULL, /* create server configuration */ | 115 NULL, /* create server configuration */ |
118 ngx_http_log_merge_loc_conf /* merge location configration */ | 119 ngx_http_log_merge_loc_conf /* merge location configration */ |
119 }; | 120 }; |
120 | 121 |
121 | 122 |
122 ngx_module_t ngx_http_log_module = { | 123 ngx_module_t ngx_http_log_module = { |
123 NGX_MODULE, | 124 NGX_MODULE_V1, |
124 &ngx_http_log_module_ctx, /* module context */ | 125 &ngx_http_log_module_ctx, /* module context */ |
125 ngx_http_log_commands, /* module directives */ | 126 ngx_http_log_commands, /* module directives */ |
126 NGX_HTTP_MODULE, /* module type */ | 127 NGX_HTTP_MODULE, /* module type */ |
127 NULL, /* init module */ | 128 NULL, /* init module */ |
128 NULL /* init process */ | 129 NULL /* init process */ |
389 | 390 |
390 if (ngx_http_headers_in[i].name.len != value->len) { | 391 if (ngx_http_headers_in[i].name.len != value->len) { |
391 continue; | 392 continue; |
392 } | 393 } |
393 | 394 |
395 /* STUB: "Cookie" speacial handling */ | |
396 if (ngx_http_headers_in[i].offset == 0) { | |
397 continue; | |
398 } | |
399 | |
394 if (ngx_strncasecmp(ngx_http_headers_in[i].name.data, value->data, | 400 if (ngx_strncasecmp(ngx_http_headers_in[i].name.data, value->data, |
395 value->len) == 0) | 401 value->len) == 0) |
396 { | 402 { |
397 op->getlen = ngx_http_log_header_in_getlen; | 403 op->getlen = ngx_http_log_header_in_getlen; |
398 op->run = ngx_http_log_header_in; | 404 op->run = ngx_http_log_header_in; |
731 | 737 |
732 static ngx_int_t | 738 static ngx_int_t |
733 ngx_http_log_variable_compile(ngx_conf_t *cf, ngx_http_log_op_t *op, | 739 ngx_http_log_variable_compile(ngx_conf_t *cf, ngx_http_log_op_t *op, |
734 ngx_str_t *value) | 740 ngx_str_t *value) |
735 { | 741 { |
736 ngx_uint_t i; | 742 ngx_int_t index; |
737 ngx_http_variable_t *var; | 743 |
738 | 744 index = ngx_http_get_variable_index(cf, value); |
739 for (i = 0; i < value->len; i++) { | 745 if (index == NGX_ERROR) { |
740 value->data[i] = ngx_toupper(value->data[i]); | |
741 } | |
742 | |
743 var = ngx_http_add_variable(cf, value, 0); | |
744 if (var == NULL) { | |
745 return NGX_ERROR; | 746 return NGX_ERROR; |
746 } | 747 } |
747 | 748 |
748 op->len = 0; | 749 op->len = 0; |
749 op->getlen = ngx_http_log_variable_getlen; | 750 op->getlen = ngx_http_log_variable_getlen; |
750 op->run = ngx_http_log_variable; | 751 op->run = ngx_http_log_variable; |
751 op->data = var->index; | 752 op->data = index; |
752 | 753 |
753 return NGX_OK; | 754 return NGX_OK; |
754 } | 755 } |
755 | 756 |
756 | 757 |
760 ngx_http_variable_value_t *value; | 761 ngx_http_variable_value_t *value; |
761 | 762 |
762 value = ngx_http_get_indexed_variable(r, data); | 763 value = ngx_http_get_indexed_variable(r, data); |
763 | 764 |
764 if (value == NULL | 765 if (value == NULL |
765 || value == NGX_HTTP_VARIABLE_NOT_FOUND | 766 || value == NGX_HTTP_VAR_NOT_FOUND |
766 || value->text.len == 0) | 767 || value->text.len == 0) |
767 { | 768 { |
768 return 1; | 769 return 1; |
769 } | 770 } |
770 | 771 |
778 ngx_http_variable_value_t *value; | 779 ngx_http_variable_value_t *value; |
779 | 780 |
780 value = ngx_http_get_indexed_variable(r, op->data); | 781 value = ngx_http_get_indexed_variable(r, op->data); |
781 | 782 |
782 if (value == NULL | 783 if (value == NULL |
783 || value == NGX_HTTP_VARIABLE_NOT_FOUND | 784 || value == NGX_HTTP_VAR_NOT_FOUND |
784 || value->text.len == 0) | 785 || value->text.len == 0) |
785 { | 786 { |
786 *buf = '-'; | 787 *buf = '-'; |
787 return buf + 1; | 788 return buf + 1; |
788 } | 789 } |