2002-08-07 00:39:45 +08:00
|
|
|
|
2004-09-28 16:34:51 +08:00
|
|
|
/*
|
2004-09-30 00:00:49 +08:00
|
|
|
* Copyright (C) Igor Sysoev
|
2004-09-28 16:34:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
#include <ngx_config.h>
|
2002-08-26 23:18:19 +08:00
|
|
|
#include <ngx_core.h>
|
2002-08-07 00:39:45 +08:00
|
|
|
#include <ngx_http.h>
|
|
|
|
|
2002-09-02 22:48:24 +08:00
|
|
|
|
2003-05-12 23:52:24 +08:00
|
|
|
static void ngx_http_init_request(ngx_event_t *ev);
|
|
|
|
static void ngx_http_process_request_line(ngx_event_t *rev);
|
|
|
|
static void ngx_http_process_request_headers(ngx_event_t *rev);
|
|
|
|
static ssize_t ngx_http_read_request_header(ngx_http_request_t *r);
|
2004-09-23 14:32:00 +08:00
|
|
|
static ngx_int_t ngx_http_alloc_large_header_buffer(ngx_http_request_t *r,
|
2005-03-19 20:38:37 +08:00
|
|
|
ngx_uint_t request_line);
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
|
|
|
static ngx_int_t ngx_http_process_header_line(ngx_http_request_t *r,
|
|
|
|
ngx_table_elt_t *h, ngx_uint_t offset);
|
2005-06-16 02:33:41 +08:00
|
|
|
static ngx_int_t ngx_http_process_unique_header_line(ngx_http_request_t *r,
|
|
|
|
ngx_table_elt_t *h, ngx_uint_t offset);
|
2008-05-15 22:44:47 +08:00
|
|
|
static ngx_int_t ngx_http_process_host(ngx_http_request_t *r,
|
|
|
|
ngx_table_elt_t *h, ngx_uint_t offset);
|
2007-09-10 02:28:49 +08:00
|
|
|
static ngx_int_t ngx_http_process_connection(ngx_http_request_t *r,
|
|
|
|
ngx_table_elt_t *h, ngx_uint_t offset);
|
2008-05-13 17:18:58 +08:00
|
|
|
static ngx_int_t ngx_http_process_user_agent(ngx_http_request_t *r,
|
|
|
|
ngx_table_elt_t *h, ngx_uint_t offset);
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
static ngx_int_t ngx_http_process_cookie(ngx_http_request_t *r,
|
|
|
|
ngx_table_elt_t *h, ngx_uint_t offset);
|
|
|
|
|
2004-06-16 23:32:11 +08:00
|
|
|
static ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r);
|
2007-06-05 04:40:03 +08:00
|
|
|
static void ngx_http_process_request(ngx_http_request_t *r);
|
2008-05-15 22:44:47 +08:00
|
|
|
static ssize_t ngx_http_validate_host(u_char *host, size_t len);
|
|
|
|
static ngx_int_t ngx_http_find_virtual_server(ngx_http_request_t *r,
|
|
|
|
u_char *host, size_t len);
|
2003-05-12 23:52:24 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
static void ngx_http_request_handler(ngx_event_t *ev);
|
2005-06-23 21:41:06 +08:00
|
|
|
static ngx_int_t ngx_http_set_write_handler(ngx_http_request_t *r);
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
static void ngx_http_writer(ngx_http_request_t *r);
|
2003-05-12 23:52:24 +08:00
|
|
|
|
2007-08-06 23:22:40 +08:00
|
|
|
static void ngx_http_test_reading(ngx_http_request_t *r);
|
2003-05-14 00:02:32 +08:00
|
|
|
static void ngx_http_set_keepalive(ngx_http_request_t *r);
|
|
|
|
static void ngx_http_keepalive_handler(ngx_event_t *ev);
|
|
|
|
static void ngx_http_set_lingering_close(ngx_http_request_t *r);
|
|
|
|
static void ngx_http_lingering_close_handler(ngx_event_t *ev);
|
2006-02-16 23:26:46 +08:00
|
|
|
static ngx_int_t ngx_http_post_action(ngx_http_request_t *r);
|
2005-07-25 17:41:38 +08:00
|
|
|
static void ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error);
|
2005-10-24 23:09:41 +08:00
|
|
|
static void ngx_http_request_done(ngx_http_request_t *r, ngx_int_t error);
|
2005-07-25 17:41:38 +08:00
|
|
|
static void ngx_http_close_connection(ngx_connection_t *c);
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
static u_char *ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len);
|
2006-07-11 21:20:19 +08:00
|
|
|
static u_char *ngx_http_log_error_handler(ngx_http_request_t *r,
|
|
|
|
ngx_http_request_t *sr, u_char *buf, size_t len);
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2005-09-07 00:09:32 +08:00
|
|
|
#if (NGX_HTTP_SSL)
|
|
|
|
static void ngx_http_ssl_handshake(ngx_event_t *rev);
|
2005-09-30 22:41:25 +08:00
|
|
|
static void ngx_http_ssl_handshake_handler(ngx_connection_t *c);
|
2005-09-07 00:09:32 +08:00
|
|
|
#endif
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
static char *ngx_http_client_errors[] = {
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
/* NGX_HTTP_PARSE_INVALID_METHOD */
|
|
|
|
"client sent invalid method",
|
2004-11-11 22:07:14 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
/* NGX_HTTP_PARSE_INVALID_REQUEST */
|
|
|
|
"client sent invalid request",
|
|
|
|
|
|
|
|
/* NGX_HTTP_PARSE_INVALID_09_METHOD */
|
|
|
|
"client sent invalid method in HTTP/0.9 request"
|
2002-08-30 00:59:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-09-07 02:45:00 +08:00
|
|
|
ngx_http_header_t ngx_http_headers_in[] = {
|
2008-08-20 03:40:45 +08:00
|
|
|
{ ngx_string("Host"), offsetof(ngx_http_headers_in_t, host),
|
|
|
|
ngx_http_process_host },
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
2008-08-20 03:40:45 +08:00
|
|
|
{ ngx_string("Connection"), offsetof(ngx_http_headers_in_t, connection),
|
|
|
|
ngx_http_process_connection },
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
2004-09-07 02:45:00 +08:00
|
|
|
{ ngx_string("If-Modified-Since"),
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
offsetof(ngx_http_headers_in_t, if_modified_since),
|
2007-08-29 23:32:49 +08:00
|
|
|
ngx_http_process_unique_header_line },
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
2008-08-20 03:40:45 +08:00
|
|
|
{ ngx_string("User-Agent"), offsetof(ngx_http_headers_in_t, user_agent),
|
|
|
|
ngx_http_process_user_agent },
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
|
|
|
{ ngx_string("Referer"), offsetof(ngx_http_headers_in_t, referer),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
|
2004-09-07 02:45:00 +08:00
|
|
|
{ ngx_string("Content-Length"),
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
offsetof(ngx_http_headers_in_t, content_length),
|
2005-06-16 02:33:41 +08:00
|
|
|
ngx_http_process_unique_header_line },
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
{ ngx_string("Content-Type"),
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
offsetof(ngx_http_headers_in_t, content_type),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
|
|
|
|
{ ngx_string("Range"), offsetof(ngx_http_headers_in_t, range),
|
|
|
|
ngx_http_process_header_line },
|
2004-09-07 02:45:00 +08:00
|
|
|
|
2007-11-09 23:41:35 +08:00
|
|
|
{ ngx_string("If-Range"),
|
|
|
|
offsetof(ngx_http_headers_in_t, if_range),
|
|
|
|
ngx_http_process_unique_header_line },
|
|
|
|
|
2005-11-26 18:11:11 +08:00
|
|
|
{ ngx_string("Transfer-Encoding"),
|
|
|
|
offsetof(ngx_http_headers_in_t, transfer_encoding),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
|
2008-06-26 21:00:39 +08:00
|
|
|
{ ngx_string("Expect"),
|
|
|
|
offsetof(ngx_http_headers_in_t, expect),
|
|
|
|
ngx_http_process_unique_header_line },
|
|
|
|
|
2004-09-07 02:45:00 +08:00
|
|
|
#if (NGX_HTTP_GZIP)
|
|
|
|
{ ngx_string("Accept-Encoding"),
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
offsetof(ngx_http_headers_in_t, accept_encoding),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
|
|
|
|
{ ngx_string("Via"), offsetof(ngx_http_headers_in_t, via),
|
|
|
|
ngx_http_process_header_line },
|
2004-09-07 02:45:00 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
{ ngx_string("Authorization"),
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
offsetof(ngx_http_headers_in_t, authorization),
|
2005-06-16 02:33:41 +08:00
|
|
|
ngx_http_process_unique_header_line },
|
2004-09-07 02:45:00 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
{ ngx_string("Keep-Alive"), offsetof(ngx_http_headers_in_t, keep_alive),
|
|
|
|
ngx_http_process_header_line },
|
2004-09-07 02:45:00 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
#if (NGX_HTTP_PROXY || NGX_HTTP_REALIP)
|
2004-09-07 02:45:00 +08:00
|
|
|
{ ngx_string("X-Forwarded-For"),
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
offsetof(ngx_http_headers_in_t, x_forwarded_for),
|
|
|
|
ngx_http_process_header_line },
|
2004-09-07 02:45:00 +08:00
|
|
|
#endif
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
#if (NGX_HTTP_REALIP)
|
|
|
|
{ ngx_string("X-Real-IP"),
|
|
|
|
offsetof(ngx_http_headers_in_t, x_real_ip),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
#endif
|
|
|
|
|
2005-02-16 21:40:36 +08:00
|
|
|
#if (NGX_HTTP_HEADERS)
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
{ ngx_string("Accept"), offsetof(ngx_http_headers_in_t, accept),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
|
2005-02-16 21:40:36 +08:00
|
|
|
{ ngx_string("Accept-Language"),
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
offsetof(ngx_http_headers_in_t, accept_language),
|
|
|
|
ngx_http_process_header_line },
|
2005-02-16 21:40:36 +08:00
|
|
|
#endif
|
|
|
|
|
2006-04-19 23:30:56 +08:00
|
|
|
#if (NGX_HTTP_DAV)
|
|
|
|
{ ngx_string("Depth"), offsetof(ngx_http_headers_in_t, depth),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
|
|
|
|
{ ngx_string("Destination"), offsetof(ngx_http_headers_in_t, destination),
|
|
|
|
ngx_http_process_header_line },
|
2006-08-30 18:39:17 +08:00
|
|
|
|
2007-01-19 05:11:23 +08:00
|
|
|
{ ngx_string("Overwrite"), offsetof(ngx_http_headers_in_t, overwrite),
|
|
|
|
ngx_http_process_header_line },
|
|
|
|
|
2006-08-30 18:39:17 +08:00
|
|
|
{ ngx_string("Date"), offsetof(ngx_http_headers_in_t, date),
|
|
|
|
ngx_http_process_header_line },
|
2006-04-19 23:30:56 +08:00
|
|
|
#endif
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
{ ngx_string("Cookie"), 0, ngx_http_process_cookie },
|
2004-09-07 02:45:00 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
{ ngx_null_string, 0, NULL }
|
|
|
|
};
|
2003-10-27 16:53:49 +08:00
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
void
|
|
|
|
ngx_http_init_connection(ngx_connection_t *c)
|
2002-08-07 00:39:45 +08:00
|
|
|
{
|
2003-05-27 20:18:54 +08:00
|
|
|
ngx_event_t *rev;
|
2003-11-20 00:26:41 +08:00
|
|
|
ngx_http_log_ctx_t *ctx;
|
2002-10-05 01:58:04 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
ctx = ngx_palloc(c->pool, sizeof(ngx_http_log_ctx_t));
|
|
|
|
if (ctx == NULL) {
|
2003-05-12 23:52:24 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2003-01-30 15:28:09 +08:00
|
|
|
}
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2007-12-30 16:01:50 +08:00
|
|
|
ctx->connection = c;
|
2004-11-11 22:07:14 +08:00
|
|
|
ctx->request = NULL;
|
2006-07-11 21:20:19 +08:00
|
|
|
ctx->current_request = NULL;
|
2005-01-25 20:27:35 +08:00
|
|
|
|
|
|
|
c->log->connection = c->number;
|
2002-08-26 23:18:19 +08:00
|
|
|
c->log->handler = ngx_http_log_error;
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->data = ctx;
|
|
|
|
c->log->action = "reading client request line";
|
|
|
|
|
2004-02-11 00:23:38 +08:00
|
|
|
c->log_error = NGX_ERROR_INFO;
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2003-05-12 23:52:24 +08:00
|
|
|
rev = c->read;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler = ngx_http_init_request;
|
2005-10-24 23:09:41 +08:00
|
|
|
c->write->handler = ngx_http_empty_handler;
|
2004-02-09 15:46:43 +08:00
|
|
|
|
2005-10-22 03:12:18 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
|
|
|
#endif
|
|
|
|
|
2003-03-21 00:09:44 +08:00
|
|
|
if (rev->ready) {
|
2004-06-07 03:49:18 +08:00
|
|
|
/* the deferred accept(), rtsig, aio, iocp */
|
2004-03-31 23:26:46 +08:00
|
|
|
|
2006-02-08 23:33:12 +08:00
|
|
|
if (ngx_use_accept_mutex) {
|
2005-10-19 20:33:58 +08:00
|
|
|
ngx_post_event(rev, &ngx_posted_events);
|
2004-03-31 23:26:46 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-05-12 23:52:24 +08:00
|
|
|
ngx_http_init_request(rev);
|
|
|
|
return;
|
2003-01-27 05:08:14 +08:00
|
|
|
}
|
2003-02-07 01:21:13 +08:00
|
|
|
|
2003-06-11 23:28:34 +08:00
|
|
|
ngx_add_timer(rev, c->listening->post_accept_timeout);
|
2003-01-27 05:08:14 +08:00
|
|
|
|
2003-10-29 16:30:44 +08:00
|
|
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
2005-10-22 03:12:18 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
|
|
|
#endif
|
2003-10-10 23:10:50 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
2002-08-07 00:39:45 +08:00
|
|
|
}
|
|
|
|
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2006-04-26 17:52:47 +08:00
|
|
|
static void
|
|
|
|
ngx_http_init_request(ngx_event_t *rev)
|
2002-08-07 00:39:45 +08:00
|
|
|
{
|
2007-04-21 15:50:19 +08:00
|
|
|
ngx_time_t *tp;
|
2006-04-26 17:52:47 +08:00
|
|
|
ngx_uint_t i;
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_connection_t *c;
|
|
|
|
ngx_http_request_t *r;
|
2005-12-27 01:07:48 +08:00
|
|
|
ngx_http_in_port_t *hip;
|
|
|
|
ngx_http_in_addr_t *hia;
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_http_log_ctx_t *ctx;
|
|
|
|
ngx_http_connection_t *hc;
|
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2005-10-22 03:12:18 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
|
|
|
#endif
|
|
|
|
|
2003-05-20 00:39:14 +08:00
|
|
|
c = rev->data;
|
|
|
|
|
2003-10-27 16:53:49 +08:00
|
|
|
if (rev->timedout) {
|
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
2004-09-16 00:00:43 +08:00
|
|
|
|
2003-10-27 16:53:49 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
hc = c->data;
|
2004-09-21 13:38:28 +08:00
|
|
|
|
2005-10-22 03:12:18 +08:00
|
|
|
if (hc == NULL) {
|
2005-03-19 20:38:37 +08:00
|
|
|
hc = ngx_pcalloc(c->pool, sizeof(ngx_http_connection_t));
|
|
|
|
if (hc == NULL) {
|
2004-09-21 13:38:28 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
2004-09-23 14:32:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
r = hc->request;
|
|
|
|
|
|
|
|
if (r) {
|
|
|
|
ngx_memzero(r, sizeof(ngx_http_request_t));
|
|
|
|
|
|
|
|
r->pipeline = hc->pipeline;
|
|
|
|
|
|
|
|
if (hc->nbusy) {
|
|
|
|
r->header_in = hc->busy[0];
|
|
|
|
}
|
2004-09-21 13:38:28 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
} else {
|
2005-03-19 20:38:37 +08:00
|
|
|
r = ngx_pcalloc(c->pool, sizeof(ngx_http_request_t));
|
|
|
|
if (r == NULL) {
|
2003-10-13 00:49:16 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
2004-06-25 00:07:04 +08:00
|
|
|
|
2004-09-21 13:38:28 +08:00
|
|
|
hc->request = r;
|
2003-05-27 20:18:54 +08:00
|
|
|
}
|
|
|
|
|
2004-09-21 13:38:28 +08:00
|
|
|
c->data = r;
|
|
|
|
r->http_connection = hc;
|
|
|
|
|
2004-06-25 00:07:04 +08:00
|
|
|
c->sent = 0;
|
2004-06-24 15:53:37 +08:00
|
|
|
r->signature = NGX_HTTP_MODULE;
|
2003-12-26 04:26:58 +08:00
|
|
|
|
2003-05-27 20:18:54 +08:00
|
|
|
/* find the server configuration for the address:port */
|
|
|
|
|
|
|
|
/* AF_INET only */
|
|
|
|
|
2006-04-26 17:52:47 +08:00
|
|
|
hip = c->listening->servers;
|
2005-12-27 01:07:48 +08:00
|
|
|
hia = hip->addrs;
|
2003-05-27 20:18:54 +08:00
|
|
|
|
2005-12-27 01:07:48 +08:00
|
|
|
r->port = hip->port;
|
|
|
|
r->port_text = &hip->port_text;
|
2003-05-27 20:18:54 +08:00
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
2007-12-30 00:00:34 +08:00
|
|
|
r->connection = c;
|
|
|
|
|
2005-12-27 01:07:48 +08:00
|
|
|
if (hip->naddrs > 1) {
|
2003-05-27 20:18:54 +08:00
|
|
|
|
2003-06-11 23:28:34 +08:00
|
|
|
/*
|
2004-08-24 03:09:29 +08:00
|
|
|
* There are several addresses on this port and one of them
|
|
|
|
* is the "*:port" wildcard so getsockname() is needed to determine
|
2003-06-11 23:28:34 +08:00
|
|
|
* the server address.
|
2004-08-24 03:09:29 +08:00
|
|
|
*
|
2007-12-30 00:00:34 +08:00
|
|
|
* AcceptEx() already has given this address.
|
2003-06-11 23:28:34 +08:00
|
|
|
*/
|
2003-05-27 20:18:54 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
#if (NGX_WIN32)
|
2003-06-11 23:28:34 +08:00
|
|
|
if (c->local_sockaddr) {
|
|
|
|
r->in_addr =
|
|
|
|
((struct sockaddr_in *) c->local_sockaddr)->sin_addr.s_addr;
|
2003-05-27 20:18:54 +08:00
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
} else
|
2003-06-11 23:28:34 +08:00
|
|
|
#endif
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
{
|
2007-12-30 00:00:34 +08:00
|
|
|
if (ngx_http_server_addr(r, NULL) != NGX_OK) {
|
2003-06-11 23:28:34 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
2003-05-27 20:18:54 +08:00
|
|
|
}
|
|
|
|
|
2006-04-26 17:52:47 +08:00
|
|
|
/* the last address is "*" */
|
2003-05-27 20:18:54 +08:00
|
|
|
|
2005-12-27 01:07:48 +08:00
|
|
|
for ( /* void */ ; i < hip->naddrs - 1; i++) {
|
|
|
|
if (hia[i].addr == r->in_addr) {
|
2003-05-27 20:18:54 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2005-12-27 01:07:48 +08:00
|
|
|
r->in_addr = hia[0].addr;
|
2003-05-27 20:18:54 +08:00
|
|
|
}
|
|
|
|
|
2005-12-27 01:07:48 +08:00
|
|
|
r->virtual_names = hia[i].virtual_names;
|
2003-05-27 20:18:54 +08:00
|
|
|
|
|
|
|
/* the default server configuration for the address:port */
|
2005-12-27 01:07:48 +08:00
|
|
|
cscf = hia[i].core_srv_conf;
|
2003-05-27 20:18:54 +08:00
|
|
|
|
|
|
|
r->main_conf = cscf->ctx->main_conf;
|
|
|
|
r->srv_conf = cscf->ctx->srv_conf;
|
|
|
|
r->loc_conf = cscf->ctx->loc_conf;
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler = ngx_http_process_request_line;
|
2004-07-17 01:11:43 +08:00
|
|
|
|
2004-07-16 00:35:51 +08:00
|
|
|
#if (NGX_HTTP_SSL)
|
|
|
|
|
2007-12-10 20:09:51 +08:00
|
|
|
{
|
|
|
|
ngx_http_ssl_srv_conf_t *sscf;
|
|
|
|
|
2004-07-17 01:11:43 +08:00
|
|
|
sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module);
|
2008-09-01 22:19:01 +08:00
|
|
|
if (sscf->enable || hia[i].ssl) {
|
2004-07-19 03:11:20 +08:00
|
|
|
|
|
|
|
if (c->ssl == NULL) {
|
2008-09-01 22:19:01 +08:00
|
|
|
|
|
|
|
c->log->action = "SSL handshaking";
|
|
|
|
|
|
|
|
if (hia[i].ssl && sscf->ssl.ctx == NULL) {
|
|
|
|
ngx_log_error(NGX_LOG_ERR, c->log, 0,
|
|
|
|
"no \"ssl_certificate\" is defined "
|
|
|
|
"in server listening on SSL port");
|
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-09-30 22:41:25 +08:00
|
|
|
if (ngx_ssl_create_connection(&sscf->ssl, c, NGX_SSL_BUFFER)
|
2005-04-08 23:18:55 +08:00
|
|
|
== NGX_ERROR)
|
2004-07-19 03:11:20 +08:00
|
|
|
{
|
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler = ngx_http_ssl_handshake;
|
2004-07-16 00:35:51 +08:00
|
|
|
}
|
|
|
|
|
2005-05-16 21:53:20 +08:00
|
|
|
r->main_filter_need_in_memory = 1;
|
2004-07-16 00:35:51 +08:00
|
|
|
}
|
2007-12-10 20:09:51 +08:00
|
|
|
}
|
2004-07-16 00:35:51 +08:00
|
|
|
|
2004-07-15 04:07:58 +08:00
|
|
|
#endif
|
|
|
|
|
2003-07-21 05:15:59 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
c->log->file = clcf->err_log->file;
|
2004-04-08 23:58:25 +08:00
|
|
|
if (!(c->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
|
|
|
|
c->log->log_level = clcf->err_log->log_level;
|
|
|
|
}
|
2003-07-21 05:15:59 +08:00
|
|
|
|
2002-09-16 23:01:44 +08:00
|
|
|
if (c->buffer == NULL) {
|
2004-05-28 23:49:23 +08:00
|
|
|
c->buffer = ngx_create_temp_buf(c->pool,
|
|
|
|
cscf->client_header_buffer_size);
|
2003-05-12 23:52:24 +08:00
|
|
|
if (c->buffer == NULL) {
|
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
2002-09-16 23:01:44 +08:00
|
|
|
}
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (r->header_in == NULL) {
|
|
|
|
r->header_in = c->buffer;
|
|
|
|
}
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
r->pool = ngx_create_pool(cscf->request_pool_size, c->log);
|
|
|
|
if (r->pool == NULL) {
|
2003-05-12 23:52:24 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2004-03-23 14:01:52 +08:00
|
|
|
|
2004-09-07 02:45:00 +08:00
|
|
|
if (ngx_list_init(&r->headers_out.headers, r->pool, 20,
|
2005-11-26 18:11:11 +08:00
|
|
|
sizeof(ngx_table_elt_t))
|
|
|
|
== NGX_ERROR)
|
2004-09-06 03:54:02 +08:00
|
|
|
{
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-05-12 23:52:24 +08:00
|
|
|
r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (r->ctx == NULL) {
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
2002-09-11 23:18:33 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
r->variables = ngx_pcalloc(r->pool, cmcf->variables.nelts
|
|
|
|
* sizeof(ngx_http_variable_value_t));
|
|
|
|
if (r->variables == NULL) {
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-07-07 14:15:04 +08:00
|
|
|
c->single_connection = 1;
|
2005-12-05 21:18:09 +08:00
|
|
|
c->destroyed = 0;
|
|
|
|
|
2005-10-04 18:38:53 +08:00
|
|
|
r->main = r;
|
|
|
|
|
2007-04-21 15:50:19 +08:00
|
|
|
tp = ngx_timeofday();
|
|
|
|
r->start_sec = tp->sec;
|
|
|
|
r->start_msec = tp->msec;
|
2005-03-01 23:20:36 +08:00
|
|
|
|
2006-04-07 22:08:04 +08:00
|
|
|
r->method = NGX_HTTP_UNKNOWN;
|
|
|
|
|
2003-04-25 22:43:13 +08:00
|
|
|
r->headers_in.content_length_n = -1;
|
2003-10-22 00:49:56 +08:00
|
|
|
r->headers_in.keep_alive_n = -1;
|
|
|
|
r->headers_out.content_length_n = -1;
|
2002-12-15 14:25:09 +08:00
|
|
|
r->headers_out.last_modified_time = -1;
|
|
|
|
|
2006-08-16 21:09:33 +08:00
|
|
|
r->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;
|
|
|
|
r->subrequests = NGX_HTTP_MAX_SUBREQUESTS + 1;
|
|
|
|
|
2004-06-25 00:07:04 +08:00
|
|
|
r->http_state = NGX_HTTP_READING_REQUEST_STATE;
|
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
ctx = c->log->data;
|
|
|
|
ctx->request = r;
|
2006-07-11 21:20:19 +08:00
|
|
|
ctx->current_request = r;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
r->log_handler = ngx_http_log_error_handler;
|
2005-03-28 22:43:02 +08:00
|
|
|
|
2004-09-15 03:39:54 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
2005-10-12 21:50:36 +08:00
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
2004-12-21 20:30:30 +08:00
|
|
|
r->stat_reading = 1;
|
2005-10-12 21:50:36 +08:00
|
|
|
ngx_atomic_fetch_add(ngx_stat_requests, 1);
|
2004-09-15 03:39:54 +08:00
|
|
|
#endif
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler(rev);
|
2004-07-17 01:11:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if (NGX_HTTP_SSL)
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static void
|
|
|
|
ngx_http_ssl_handshake(ngx_event_t *rev)
|
2004-07-17 01:11:43 +08:00
|
|
|
{
|
|
|
|
u_char buf[1];
|
2004-11-11 22:07:14 +08:00
|
|
|
ssize_t n;
|
|
|
|
ngx_int_t rc;
|
2004-07-17 01:11:43 +08:00
|
|
|
ngx_connection_t *c;
|
|
|
|
ngx_http_request_t *r;
|
|
|
|
|
|
|
|
c = rev->data;
|
|
|
|
r = c->data;
|
|
|
|
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,
|
|
|
|
"http check ssl handshake");
|
|
|
|
|
|
|
|
if (rev->timedout) {
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
|
|
|
c->timedout = 1;
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);
|
2004-07-17 01:11:43 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
n = recv(c->fd, (char *) buf, 1, MSG_PEEK);
|
2004-07-17 01:11:43 +08:00
|
|
|
|
|
|
|
if (n == -1 && ngx_socket_errno == NGX_EAGAIN) {
|
2008-01-09 04:51:06 +08:00
|
|
|
|
|
|
|
if (!rev->timer_set) {
|
|
|
|
ngx_add_timer(rev, c->listening->post_accept_timeout);
|
|
|
|
}
|
|
|
|
|
2008-01-09 16:21:57 +08:00
|
|
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
}
|
|
|
|
|
2004-07-17 01:11:43 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (n == 1) {
|
|
|
|
if (buf[0] == 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, rev->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"https ssl handshake: 0x%02Xd", buf[0]);
|
2004-07-17 01:11:43 +08:00
|
|
|
|
2004-07-19 03:11:20 +08:00
|
|
|
rc = ngx_ssl_handshake(c);
|
|
|
|
|
2005-09-30 22:41:25 +08:00
|
|
|
if (rc == NGX_AGAIN) {
|
2008-01-04 17:32:12 +08:00
|
|
|
|
|
|
|
if (!rev->timer_set) {
|
|
|
|
ngx_add_timer(rev, c->listening->post_accept_timeout);
|
|
|
|
}
|
|
|
|
|
2005-09-30 22:41:25 +08:00
|
|
|
c->ssl->handler = ngx_http_ssl_handshake_handler;
|
2004-07-19 03:11:20 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-09-30 22:41:25 +08:00
|
|
|
ngx_http_ssl_handshake_handler(c);
|
|
|
|
|
|
|
|
return;
|
2004-07-17 01:11:43 +08:00
|
|
|
|
|
|
|
} else {
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,
|
|
|
|
"plain http");
|
|
|
|
|
|
|
|
r->plain_http = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-01 22:19:01 +08:00
|
|
|
c->log->action = "reading client request line";
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler = ngx_http_process_request_line;
|
2003-05-12 23:52:24 +08:00
|
|
|
ngx_http_process_request_line(rev);
|
2002-08-07 00:39:45 +08:00
|
|
|
}
|
|
|
|
|
2005-09-30 22:41:25 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
ngx_http_ssl_handshake_handler(ngx_connection_t *c)
|
|
|
|
{
|
|
|
|
ngx_http_request_t *r;
|
|
|
|
|
|
|
|
if (c->ssl->handshaked) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The majority of browsers do not send the "close notify" alert.
|
|
|
|
* Among them are MSIE, old Mozilla, Netscape 4, Konqueror,
|
|
|
|
* and Links. And what is more, MSIE ignores the server's alert.
|
|
|
|
*
|
|
|
|
* Opera and recent Mozilla send the alert.
|
|
|
|
*/
|
|
|
|
|
|
|
|
c->ssl->no_wait_shutdown = 1;
|
|
|
|
|
|
|
|
c->read->handler = ngx_http_process_request_line;
|
|
|
|
/* STUB: epoll edge */ c->write->handler = ngx_http_empty_handler;
|
|
|
|
|
|
|
|
ngx_http_process_request_line(c->read);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
r = c->data;
|
|
|
|
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_BAD_REQUEST);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-05-29 23:21:09 +08:00
|
|
|
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
|
|
|
|
|
|
|
|
int
|
|
|
|
ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg)
|
|
|
|
{
|
2008-08-21 20:56:10 +08:00
|
|
|
size_t len;
|
2007-05-29 23:21:09 +08:00
|
|
|
const char *servername;
|
|
|
|
ngx_connection_t *c;
|
|
|
|
ngx_http_request_t *r;
|
|
|
|
ngx_http_ssl_srv_conf_t *sscf;
|
|
|
|
|
|
|
|
servername = SSL_get_servername(ssl_conn, TLSEXT_NAMETYPE_host_name);
|
|
|
|
|
|
|
|
if (servername == NULL) {
|
|
|
|
return SSL_TLSEXT_ERR_NOACK;
|
|
|
|
}
|
|
|
|
|
|
|
|
c = ngx_ssl_get_connection(ssl_conn);
|
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
|
|
|
"SSL server name: \"%s\"", servername);
|
|
|
|
|
2008-08-21 20:56:10 +08:00
|
|
|
len = ngx_strlen(servername);
|
|
|
|
|
|
|
|
if (len == 0) {
|
|
|
|
return SSL_TLSEXT_ERR_NOACK;
|
|
|
|
}
|
|
|
|
|
2007-05-29 23:21:09 +08:00
|
|
|
r = c->data;
|
|
|
|
|
2008-08-21 20:56:10 +08:00
|
|
|
if (ngx_http_find_virtual_server(r, (u_char *) servername, len) != NGX_OK) {
|
2007-05-29 23:21:09 +08:00
|
|
|
return SSL_TLSEXT_ERR_NOACK;
|
|
|
|
}
|
|
|
|
|
|
|
|
sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module);
|
|
|
|
|
|
|
|
SSL_set_SSL_CTX(ssl_conn, sscf->ssl.ctx);
|
|
|
|
|
|
|
|
return SSL_TLSEXT_ERR_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2005-09-30 22:41:25 +08:00
|
|
|
|
2004-07-17 01:11:43 +08:00
|
|
|
#endif
|
|
|
|
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static void
|
|
|
|
ngx_http_process_request_line(ngx_event_t *rev)
|
2002-08-07 00:39:45 +08:00
|
|
|
{
|
2007-10-18 19:36:58 +08:00
|
|
|
ssize_t n;
|
|
|
|
ngx_int_t rc, rv;
|
|
|
|
ngx_connection_t *c;
|
|
|
|
ngx_http_request_t *r;
|
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2003-05-20 00:39:14 +08:00
|
|
|
c = rev->data;
|
|
|
|
r = c->data;
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2003-12-09 23:08:11 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,
|
|
|
|
"http process request line");
|
2003-03-21 00:09:44 +08:00
|
|
|
|
|
|
|
if (rev->timedout) {
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
|
|
|
c->timedout = 1;
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);
|
2003-05-12 23:52:24 +08:00
|
|
|
return;
|
2003-03-21 00:09:44 +08:00
|
|
|
}
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
rc = NGX_AGAIN;
|
2003-05-12 23:52:24 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
for ( ;; ) {
|
2003-05-20 00:39:14 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (rc == NGX_AGAIN) {
|
|
|
|
n = ngx_http_read_request_header(r);
|
2003-05-12 23:52:24 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (n == NGX_AGAIN || n == NGX_ERROR) {
|
|
|
|
return;
|
|
|
|
}
|
2003-04-08 23:40:10 +08:00
|
|
|
}
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
rc = ngx_http_parse_request_line(r, r->header_in);
|
2003-10-25 00:10:38 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (rc == NGX_OK) {
|
2003-11-29 01:41:47 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
/* the request line has been parsed successfully */
|
2003-11-29 01:41:47 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
r->request_line.len = r->request_end - r->request_start;
|
|
|
|
r->request_line.data = r->request_start;
|
2008-08-04 19:10:52 +08:00
|
|
|
*r->request_end = '\0';
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2003-05-20 00:39:14 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (r->args_start) {
|
|
|
|
r->uri.len = r->args_start - 1 - r->uri_start;
|
|
|
|
} else {
|
|
|
|
r->uri.len = r->uri_end - r->uri_start;
|
2003-12-01 04:03:18 +08:00
|
|
|
}
|
|
|
|
|
2004-11-26 00:17:31 +08:00
|
|
|
|
2004-10-11 23:07:03 +08:00
|
|
|
if (r->complex_uri || r->quoted_uri) {
|
2004-11-11 22:07:14 +08:00
|
|
|
|
2008-06-17 23:00:30 +08:00
|
|
|
r->uri.data = ngx_pnalloc(r->pool, r->uri.len + 1);
|
2005-03-19 20:38:37 +08:00
|
|
|
if (r->uri.data == NULL) {
|
2004-11-11 22:07:14 +08:00
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-10-18 19:36:58 +08:00
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
rc = ngx_http_parse_complex_uri(r, cscf->merge_slashes);
|
2003-05-20 00:39:14 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
if (rc == NGX_HTTP_PARSE_INVALID_REQUEST) {
|
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
"client sent invalid request");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
2004-09-23 14:32:00 +08:00
|
|
|
return;
|
|
|
|
}
|
2003-11-20 15:05:50 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
} else {
|
2004-11-11 22:07:14 +08:00
|
|
|
r->uri.data = r->uri_start;
|
2003-05-12 23:52:24 +08:00
|
|
|
}
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2004-11-26 00:17:31 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
r->unparsed_uri.len = r->uri_end - r->uri_start;
|
|
|
|
r->unparsed_uri.data = r->uri_start;
|
2002-12-03 23:45:38 +08:00
|
|
|
|
2003-03-04 14:33:48 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
r->method_name.len = r->method_end - r->request_start + 1;
|
|
|
|
r->method_name.data = r->request_line.data;
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2003-11-20 15:05:50 +08:00
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
if (r->http_protocol.data) {
|
|
|
|
r->http_protocol.len = r->request_end - r->http_protocol.data;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
if (r->uri_ext) {
|
2004-09-23 14:32:00 +08:00
|
|
|
if (r->args_start) {
|
|
|
|
r->exten.len = r->args_start - 1 - r->uri_ext;
|
|
|
|
} else {
|
|
|
|
r->exten.len = r->uri_end - r->uri_ext;
|
|
|
|
}
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
r->exten.data = r->uri_ext;
|
2003-05-12 23:52:24 +08:00
|
|
|
}
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2003-11-20 15:05:50 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
if (r->args_start && r->uri_end > r->args_start) {
|
2004-09-23 14:32:00 +08:00
|
|
|
r->args.len = r->uri_end - r->args_start;
|
2004-11-11 22:07:14 +08:00
|
|
|
r->args.data = r->args_start;
|
2003-05-12 23:52:24 +08:00
|
|
|
}
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"http request line: \"%V\"", &r->request_line);
|
2003-12-15 04:10:27 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"http uri: \"%V\"", &r->uri);
|
2003-12-15 04:10:27 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"http args: \"%V\"", &r->args);
|
2003-12-15 04:10:27 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"http exten: \"%V\"", &r->exten);
|
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
if (r->host_start && r->host_end) {
|
|
|
|
n = ngx_http_validate_host(r->host_start,
|
|
|
|
r->host_end - r->host_start);
|
|
|
|
|
|
|
|
if (n <= 0) {
|
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
"client sent invalid host in request line");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->headers_in.server.len = n;
|
|
|
|
r->headers_in.server.data = r->host_start;
|
|
|
|
}
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (r->http_version < NGX_HTTP_VERSION_10) {
|
2008-05-15 22:44:47 +08:00
|
|
|
|
|
|
|
if (ngx_http_find_virtual_server(r, r->headers_in.server.data,
|
|
|
|
r->headers_in.server.len)
|
|
|
|
== NGX_ERROR)
|
|
|
|
{
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-06-05 04:40:03 +08:00
|
|
|
ngx_http_process_request(r);
|
2004-09-23 14:32:00 +08:00
|
|
|
return;
|
|
|
|
}
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2004-03-23 14:01:52 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (ngx_list_init(&r->headers_in.headers, r->pool, 20,
|
2005-11-26 18:11:11 +08:00
|
|
|
sizeof(ngx_table_elt_t))
|
|
|
|
== NGX_ERROR)
|
2004-09-23 14:32:00 +08:00
|
|
|
{
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
2004-03-23 14:01:52 +08:00
|
|
|
|
|
|
|
|
2005-03-04 22:06:57 +08:00
|
|
|
if (ngx_array_init(&r->headers_in.cookies, r->pool, 2,
|
2005-11-26 18:11:11 +08:00
|
|
|
sizeof(ngx_table_elt_t *))
|
|
|
|
== NGX_ERROR)
|
2004-09-23 14:32:00 +08:00
|
|
|
{
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
2004-08-27 23:40:59 +08:00
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->action = "reading client request headers";
|
2002-08-30 00:59:54 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler = ngx_http_process_request_headers;
|
2004-09-23 14:32:00 +08:00
|
|
|
ngx_http_process_request_headers(rev);
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
return;
|
2005-03-28 22:43:02 +08:00
|
|
|
}
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
if (rc != NGX_AGAIN) {
|
2003-03-06 01:30:51 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
/* there was error while a request line parsing */
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
ngx_http_client_errors[rc - NGX_HTTP_CLIENT_ERROR]);
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
2004-09-23 14:32:00 +08:00
|
|
|
return;
|
|
|
|
}
|
2003-03-06 01:30:51 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
/* NGX_AGAIN: a request line parsing is still incomplete */
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
if (r->header_in->pos == r->header_in->end) {
|
2003-03-06 01:30:51 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
rv = ngx_http_alloc_large_header_buffer(r, 1);
|
2003-05-20 00:39:14 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (rv == NGX_ERROR) {
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
2003-03-06 01:30:51 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (rv == NGX_DECLINED) {
|
2005-03-28 22:43:02 +08:00
|
|
|
r->request_line.len = r->header_in->end - r->request_start;
|
|
|
|
r->request_line.data = r->request_start;
|
|
|
|
|
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
"client sent too long URI");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_REQUEST_URI_TOO_LARGE);
|
2003-05-12 23:52:24 +08:00
|
|
|
return;
|
2003-03-06 01:30:51 +08:00
|
|
|
}
|
|
|
|
}
|
2002-09-13 22:47:42 +08:00
|
|
|
}
|
2002-08-07 00:39:45 +08:00
|
|
|
}
|
|
|
|
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static void
|
|
|
|
ngx_http_process_request_headers(ngx_event_t *rev)
|
2002-08-07 00:39:45 +08:00
|
|
|
{
|
2005-04-08 23:18:55 +08:00
|
|
|
ssize_t n;
|
|
|
|
ngx_int_t rc, rv;
|
|
|
|
ngx_str_t header;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_table_elt_t *h;
|
2005-04-08 23:18:55 +08:00
|
|
|
ngx_connection_t *c;
|
|
|
|
ngx_http_header_t *hh;
|
|
|
|
ngx_http_request_t *r;
|
2005-05-15 02:42:03 +08:00
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2005-04-08 23:18:55 +08:00
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
2003-05-20 00:39:14 +08:00
|
|
|
|
|
|
|
c = rev->data;
|
|
|
|
r = c->data;
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2003-12-01 04:03:18 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,
|
|
|
|
"http process request header line");
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2003-05-12 23:52:24 +08:00
|
|
|
if (rev->timedout) {
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
|
|
|
c->timedout = 1;
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);
|
2003-05-12 23:52:24 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-04-08 23:18:55 +08:00
|
|
|
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
2005-05-15 02:42:03 +08:00
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
2005-04-08 23:18:55 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
rc = NGX_AGAIN;
|
2003-05-12 23:52:24 +08:00
|
|
|
|
2002-08-30 00:59:54 +08:00
|
|
|
for ( ;; ) {
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
if (rc == NGX_AGAIN) {
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
if (r->header_in->pos == r->header_in->end) {
|
2004-09-23 14:32:00 +08:00
|
|
|
|
|
|
|
rv = ngx_http_alloc_large_header_buffer(r, 0);
|
|
|
|
|
|
|
|
if (rv == NGX_ERROR) {
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rv == NGX_DECLINED) {
|
2005-03-28 22:43:02 +08:00
|
|
|
header.len = r->header_in->end - r->header_name_start;
|
|
|
|
header.data = r->header_name_start;
|
2005-07-25 17:41:38 +08:00
|
|
|
|
|
|
|
if (header.len > NGX_MAX_ERROR_STR - 300) {
|
|
|
|
header.len = NGX_MAX_ERROR_STR - 300;
|
|
|
|
header.data[header.len++] = '.';
|
|
|
|
header.data[header.len++] = '.';
|
|
|
|
header.data[header.len++] = '.';
|
|
|
|
}
|
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
"client sent too long header line: \"%V\"",
|
|
|
|
&header);
|
2007-08-28 04:52:40 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
2004-09-23 14:32:00 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
n = ngx_http_read_request_header(r);
|
2002-08-30 00:59:54 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
if (n == NGX_AGAIN || n == NGX_ERROR) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-03 23:50:53 +08:00
|
|
|
rc = ngx_http_parse_header_line(r, r->header_in);
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2003-03-06 01:30:51 +08:00
|
|
|
if (rc == NGX_OK) {
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2005-05-15 02:42:03 +08:00
|
|
|
if (r->invalid_header && cscf->ignore_invalid_headers) {
|
2005-03-23 00:02:46 +08:00
|
|
|
|
|
|
|
/* there was error while a header line parsing */
|
|
|
|
|
|
|
|
header.len = r->header_end - r->header_name_start;
|
|
|
|
header.data = r->header_name_start;
|
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
"client sent invalid header line: \"%V\"",
|
2005-03-23 00:02:46 +08:00
|
|
|
&header);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
/* a header line has been parsed successfully */
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
h = ngx_list_push(&r->headers_in.headers);
|
|
|
|
if (h == NULL) {
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
2003-03-21 00:09:44 +08:00
|
|
|
}
|
|
|
|
|
2005-04-08 23:18:55 +08:00
|
|
|
h->hash = r->header_hash;
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
h->key.len = r->header_name_end - r->header_name_start;
|
2004-09-23 14:32:00 +08:00
|
|
|
h->key.data = r->header_name_start;
|
|
|
|
h->key.data[h->key.len] = '\0';
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
h->value.len = r->header_end - r->header_start;
|
|
|
|
h->value.data = r->header_start;
|
|
|
|
h->value.data[h->value.len] = '\0';
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2008-06-17 23:00:30 +08:00
|
|
|
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
|
2006-05-11 22:43:47 +08:00
|
|
|
if (h->lowcase_key == NULL) {
|
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
2006-05-11 22:43:47 +08:00
|
|
|
if (h->key.len == r->lowcase_index) {
|
|
|
|
ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
|
|
|
|
|
|
|
|
} else {
|
2008-08-04 18:07:00 +08:00
|
|
|
ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
|
2003-05-14 00:02:32 +08:00
|
|
|
}
|
|
|
|
|
2006-05-11 22:43:47 +08:00
|
|
|
hh = ngx_hash_find(&cmcf->headers_in_hash, h->hash,
|
|
|
|
h->lowcase_key, h->key.len);
|
|
|
|
|
|
|
|
if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"http header: \"%V: %V\"",
|
|
|
|
&h->key, &h->value);
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2003-05-27 20:18:54 +08:00
|
|
|
continue;
|
2005-03-28 22:43:02 +08:00
|
|
|
}
|
2003-05-27 20:18:54 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
|
2002-09-02 22:48:24 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
/* a whole header has been parsed successfully */
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http header done");
|
2002-12-15 14:25:09 +08:00
|
|
|
|
2004-12-06 22:45:08 +08:00
|
|
|
r->request_length += r->header_in->pos - r->header_in->start;
|
|
|
|
|
2004-06-25 00:07:04 +08:00
|
|
|
r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;
|
|
|
|
|
2003-10-22 00:49:56 +08:00
|
|
|
rc = ngx_http_process_request_header(r);
|
2003-10-13 00:49:16 +08:00
|
|
|
|
2003-10-22 00:49:56 +08:00
|
|
|
if (rc != NGX_OK) {
|
|
|
|
return;
|
2003-04-25 22:43:13 +08:00
|
|
|
}
|
|
|
|
|
2007-06-05 04:40:03 +08:00
|
|
|
ngx_http_process_request(r);
|
2005-08-30 18:55:07 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
return;
|
2005-03-28 22:43:02 +08:00
|
|
|
}
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
if (rc == NGX_AGAIN) {
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
/* a header line parsing is still not complete */
|
2003-12-22 17:40:48 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
continue;
|
2003-03-06 01:30:51 +08:00
|
|
|
}
|
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
/* rc == NGX_HTTP_PARSE_INVALID_HEADER: "\r" is not followed by "\n" */
|
2003-03-06 01:30:51 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
header.len = r->header_end - r->header_name_start;
|
|
|
|
header.data = r->header_name_start;
|
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
"client sent invalid header line: \"%V\\r...\"",
|
|
|
|
&header);
|
2007-08-28 04:52:40 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
2005-03-28 22:43:02 +08:00
|
|
|
return;
|
2002-08-30 00:59:54 +08:00
|
|
|
}
|
2002-09-02 22:48:24 +08:00
|
|
|
}
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static ssize_t
|
|
|
|
ngx_http_read_request_header(ngx_http_request_t *r)
|
2002-09-02 22:48:24 +08:00
|
|
|
{
|
2003-05-23 19:53:01 +08:00
|
|
|
ssize_t n;
|
|
|
|
ngx_event_t *rev;
|
2006-08-30 18:39:17 +08:00
|
|
|
ngx_connection_t *c;
|
2003-05-23 19:53:01 +08:00
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2002-12-03 00:09:40 +08:00
|
|
|
|
2006-08-30 18:39:17 +08:00
|
|
|
c = r->connection;
|
|
|
|
rev = c->read;
|
2003-06-11 23:28:34 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
n = r->header_in->last - r->header_in->pos;
|
2002-12-03 00:09:40 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
if (n > 0) {
|
|
|
|
return n;
|
|
|
|
}
|
2003-03-04 14:33:48 +08:00
|
|
|
|
2005-06-16 02:33:41 +08:00
|
|
|
if (rev->ready) {
|
2006-08-30 18:39:17 +08:00
|
|
|
n = c->recv(c, r->header_in->last,
|
|
|
|
r->header_in->end - r->header_in->last);
|
2005-06-16 02:33:41 +08:00
|
|
|
} else {
|
|
|
|
n = NGX_AGAIN;
|
2003-11-19 00:49:00 +08:00
|
|
|
}
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
if (n == NGX_AGAIN) {
|
2008-01-09 04:55:27 +08:00
|
|
|
if (!rev->timer_set) {
|
2004-07-17 01:11:43 +08:00
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
2003-05-23 19:53:01 +08:00
|
|
|
ngx_add_timer(rev, cscf->client_header_timeout);
|
2003-01-28 23:56:37 +08:00
|
|
|
}
|
|
|
|
|
2003-10-29 16:30:44 +08:00
|
|
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
2003-10-10 23:10:50 +08:00
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
return NGX_AGAIN;
|
2002-12-03 00:09:40 +08:00
|
|
|
}
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
if (n == 0) {
|
2006-08-30 18:39:17 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
2003-05-14 00:02:32 +08:00
|
|
|
"client closed prematurely connection");
|
|
|
|
}
|
2002-09-02 22:48:24 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
if (n == 0 || n == NGX_ERROR) {
|
2007-01-09 02:22:06 +08:00
|
|
|
c->error = 1;
|
2007-01-09 02:23:38 +08:00
|
|
|
c->log->action = "reading client request headers";
|
2006-08-30 18:39:17 +08:00
|
|
|
|
2007-01-09 02:22:06 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
2003-05-14 00:02:32 +08:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->header_in->last += n;
|
|
|
|
|
|
|
|
return n;
|
2002-09-02 22:48:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_alloc_large_header_buffer(ngx_http_request_t *r,
|
|
|
|
ngx_uint_t request_line)
|
2004-09-23 00:18:21 +08:00
|
|
|
{
|
|
|
|
u_char *old, *new;
|
|
|
|
ngx_buf_t *b;
|
|
|
|
ngx_http_connection_t *hc;
|
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
|
|
|
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http alloc large header buffer");
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (request_line && r->state == 0) {
|
|
|
|
|
|
|
|
/* the client fills up the buffer with "\r\n" */
|
|
|
|
|
2004-12-06 22:45:08 +08:00
|
|
|
r->request_length += r->header_in->end - r->header_in->start;
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
r->header_in->pos = r->header_in->start;
|
|
|
|
r->header_in->last = r->header_in->start;
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
2004-09-23 00:18:21 +08:00
|
|
|
old = request_line ? r->request_start : r->header_name_start;
|
|
|
|
|
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (r->state != 0
|
|
|
|
&& (size_t) (r->header_in->pos - old)
|
|
|
|
>= cscf->large_client_header_buffers.size)
|
|
|
|
{
|
2004-09-23 00:18:21 +08:00
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
hc = r->http_connection;
|
|
|
|
|
|
|
|
if (hc->nfree) {
|
|
|
|
b = hc->free[--hc->nfree];
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"http large header free: %p %uz",
|
2004-09-24 00:39:34 +08:00
|
|
|
b->pos, b->end - b->last);
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
} else if (hc->nbusy < cscf->large_client_header_buffers.num) {
|
2004-09-23 00:18:21 +08:00
|
|
|
|
|
|
|
if (hc->busy == NULL) {
|
|
|
|
hc->busy = ngx_palloc(r->connection->pool,
|
2004-09-23 14:32:00 +08:00
|
|
|
cscf->large_client_header_buffers.num * sizeof(ngx_buf_t *));
|
2004-09-23 00:18:21 +08:00
|
|
|
if (hc->busy == NULL) {
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
b = ngx_create_temp_buf(r->connection->pool,
|
2004-09-23 14:32:00 +08:00
|
|
|
cscf->large_client_header_buffers.size);
|
2004-09-23 00:18:21 +08:00
|
|
|
if (b == NULL) {
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2004-11-11 22:07:14 +08:00
|
|
|
"http large header alloc: %p %uz",
|
2004-09-24 00:39:34 +08:00
|
|
|
b->pos, b->end - b->last);
|
|
|
|
|
2004-09-23 00:18:21 +08:00
|
|
|
} else {
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
hc->busy[hc->nbusy++] = b;
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (r->state == 0) {
|
|
|
|
/*
|
|
|
|
* r->state == 0 means that a header line was parsed successfully
|
|
|
|
* and we do not need to copy incomplete header line and
|
|
|
|
* to relocate the parser header pointers
|
|
|
|
*/
|
|
|
|
|
2004-12-06 22:45:08 +08:00
|
|
|
r->request_length += r->header_in->end - r->header_in->start;
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
r->header_in = b;
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http large header copy: %d", r->header_in->pos - old);
|
|
|
|
|
2004-12-06 22:45:08 +08:00
|
|
|
r->request_length += old - r->header_in->start;
|
|
|
|
|
2004-09-23 00:18:21 +08:00
|
|
|
new = b->start;
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
ngx_memcpy(new, old, r->header_in->pos - old);
|
2004-09-23 00:18:21 +08:00
|
|
|
|
|
|
|
b->pos = new + (r->header_in->pos - old);
|
2004-09-24 00:39:34 +08:00
|
|
|
b->last = new + (r->header_in->pos - old);
|
2004-09-23 00:18:21 +08:00
|
|
|
|
|
|
|
if (request_line) {
|
|
|
|
r->request_start = new;
|
2004-09-23 14:32:00 +08:00
|
|
|
|
|
|
|
if (r->request_end) {
|
|
|
|
r->request_end = new + (r->request_end - old);
|
|
|
|
}
|
|
|
|
|
|
|
|
r->method_end = new + (r->method_end - old);
|
2004-09-23 00:18:21 +08:00
|
|
|
|
|
|
|
r->uri_start = new + (r->uri_start - old);
|
|
|
|
r->uri_end = new + (r->uri_end - old);
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (r->schema_start) {
|
|
|
|
r->schema_start = new + (r->schema_start - old);
|
|
|
|
r->schema_end = new + (r->schema_end - old);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->host_start) {
|
|
|
|
r->host_start = new + (r->host_start - old);
|
2006-12-15 18:24:57 +08:00
|
|
|
if (r->host_end) {
|
|
|
|
r->host_end = new + (r->host_end - old);
|
|
|
|
}
|
2004-09-23 14:32:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (r->port_start) {
|
|
|
|
r->port_start = new + (r->port_start - old);
|
|
|
|
r->port_end = new + (r->port_end - old);
|
|
|
|
}
|
|
|
|
|
2004-09-23 00:18:21 +08:00
|
|
|
if (r->uri_ext) {
|
|
|
|
r->uri_ext = new + (r->uri_ext - old);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->args_start) {
|
|
|
|
r->args_start = new + (r->args_start - old);
|
|
|
|
}
|
|
|
|
|
2007-12-01 20:22:48 +08:00
|
|
|
if (r->http_protocol.data) {
|
|
|
|
r->http_protocol.data = new + (r->http_protocol.data - old);
|
|
|
|
}
|
|
|
|
|
2004-09-23 00:18:21 +08:00
|
|
|
} else {
|
|
|
|
r->header_name_start = new;
|
|
|
|
r->header_name_end = new + (r->header_name_end - old);
|
|
|
|
r->header_start = new + (r->header_start - old);
|
|
|
|
r->header_end = new + (r->header_end - old);
|
|
|
|
}
|
|
|
|
|
|
|
|
r->header_in = b;
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_process_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
|
|
|
|
ngx_uint_t offset)
|
|
|
|
{
|
|
|
|
ngx_table_elt_t **ph;
|
|
|
|
|
|
|
|
ph = (ngx_table_elt_t **) ((char *) &r->headers_in + offset);
|
|
|
|
|
|
|
|
if (*ph == NULL) {
|
|
|
|
*ph = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-16 02:33:41 +08:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_process_unique_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
|
|
|
|
ngx_uint_t offset)
|
|
|
|
{
|
|
|
|
ngx_table_elt_t **ph;
|
|
|
|
|
|
|
|
ph = (ngx_table_elt_t **) ((char *) &r->headers_in + offset);
|
|
|
|
|
|
|
|
if (*ph == NULL) {
|
|
|
|
*ph = h;
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
2006-08-30 18:39:17 +08:00
|
|
|
"client sent duplicate header line: \"%V: %V\", "
|
|
|
|
"previous value: \"%V: %V\"",
|
|
|
|
&h->key, &h->value, &(*ph)->key, &(*ph)->value);
|
2005-06-16 02:33:41 +08:00
|
|
|
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
|
|
|
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-10 02:28:49 +08:00
|
|
|
static ngx_int_t
|
2008-05-15 22:44:47 +08:00
|
|
|
ngx_http_process_host(ngx_http_request_t *r, ngx_table_elt_t *h,
|
2007-09-10 02:28:49 +08:00
|
|
|
ngx_uint_t offset)
|
|
|
|
{
|
2008-05-15 22:44:47 +08:00
|
|
|
ssize_t len;
|
2007-09-10 02:28:49 +08:00
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
if (r->headers_in.host == NULL) {
|
|
|
|
r->headers_in.host = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
len = ngx_http_validate_host(h->value.data, h->value.len);
|
|
|
|
|
|
|
|
if (len <= 0) {
|
|
|
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
|
|
|
"client sent invalid host header");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->headers_in.server.len) {
|
|
|
|
return NGX_OK;
|
2007-09-10 02:28:49 +08:00
|
|
|
}
|
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
r->headers_in.server.len = len;
|
|
|
|
r->headers_in.server.data = h->value.data;
|
|
|
|
|
2007-09-10 02:28:49 +08:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
static ngx_int_t
|
2008-05-15 22:44:47 +08:00
|
|
|
ngx_http_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h,
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_uint_t offset)
|
|
|
|
{
|
2008-05-15 22:44:47 +08:00
|
|
|
if (ngx_strcasestrn(h->value.data, "close", 5 - 1)) {
|
|
|
|
r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
} else if (ngx_strcasestrn(h->value.data, "keep-alive", 10 - 1)) {
|
|
|
|
r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
}
|
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
return NGX_OK;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-13 17:18:58 +08:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_process_user_agent(ngx_http_request_t *r, ngx_table_elt_t *h,
|
|
|
|
ngx_uint_t offset)
|
|
|
|
{
|
2008-08-26 23:09:28 +08:00
|
|
|
u_char *user_agent, *msie;
|
2008-05-13 17:18:58 +08:00
|
|
|
|
|
|
|
if (r->headers_in.user_agent) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->headers_in.user_agent = h;
|
|
|
|
|
|
|
|
/* check some widespread browsers while the header is in CPU cache */
|
|
|
|
|
|
|
|
user_agent = h->value.data;
|
|
|
|
|
2008-08-26 23:09:28 +08:00
|
|
|
msie = ngx_strstrn(user_agent, "MSIE ", 5 - 1);
|
2008-05-13 17:18:58 +08:00
|
|
|
|
2008-08-26 23:09:28 +08:00
|
|
|
if (msie && msie + 7 < user_agent + h->value.len) {
|
2008-05-13 17:18:58 +08:00
|
|
|
|
|
|
|
r->headers_in.msie = 1;
|
|
|
|
|
2008-08-26 23:09:28 +08:00
|
|
|
if (msie[6] == '.') {
|
|
|
|
|
|
|
|
switch (msie[5]) {
|
|
|
|
case '4':
|
|
|
|
r->headers_in.msie4 = 1;
|
|
|
|
/* fall through */
|
|
|
|
case '5':
|
|
|
|
case '6':
|
|
|
|
r->headers_in.msie6 = 1;
|
|
|
|
}
|
2008-05-13 17:18:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* MSIE ignores the SSL "close notify" alert */
|
|
|
|
if (c->ssl) {
|
|
|
|
c->ssl->no_send_shutdown = 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_strstrn(user_agent, "Opera", 5 - 1)) {
|
|
|
|
r->headers_in.opera = 1;
|
|
|
|
r->headers_in.msie = 0;
|
|
|
|
r->headers_in.msie4 = 0;
|
2008-08-26 23:09:28 +08:00
|
|
|
r->headers_in.msie6 = 0;
|
2008-05-13 17:18:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!r->headers_in.msie && !r->headers_in.opera) {
|
|
|
|
|
|
|
|
if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) {
|
|
|
|
r->headers_in.gecko = 1;
|
|
|
|
|
|
|
|
} else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {
|
|
|
|
r->headers_in.konqueror = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static ngx_int_t
|
2008-05-15 22:44:47 +08:00
|
|
|
ngx_http_process_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
|
|
|
|
ngx_uint_t offset)
|
2003-10-22 00:49:56 +08:00
|
|
|
{
|
2008-05-15 22:44:47 +08:00
|
|
|
ngx_table_elt_t **cookie;
|
2007-05-29 23:21:09 +08:00
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
cookie = ngx_array_push(&r->headers_in.cookies);
|
|
|
|
if (cookie) {
|
|
|
|
*cookie = h;
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
2007-05-29 23:21:09 +08:00
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
2007-05-29 23:21:09 +08:00
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
2007-05-29 23:21:09 +08:00
|
|
|
|
2004-05-15 00:51:47 +08:00
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_process_request_header(ngx_http_request_t *r)
|
|
|
|
{
|
|
|
|
if (ngx_http_find_virtual_server(r, r->headers_in.server.data,
|
|
|
|
r->headers_in.server.len)
|
|
|
|
== NGX_ERROR)
|
|
|
|
{
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
2005-03-28 22:43:02 +08:00
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
if (r->headers_in.host == NULL && r->http_version > NGX_HTTP_VERSION_10) {
|
|
|
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
|
|
|
"client sent HTTP/1.1 request without \"Host\" header");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
|
|
|
|
return NGX_ERROR;
|
2003-10-22 00:49:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (r->headers_in.content_length) {
|
|
|
|
r->headers_in.content_length_n =
|
2006-07-08 00:33:19 +08:00
|
|
|
ngx_atoof(r->headers_in.content_length->value.data,
|
2003-10-22 00:49:56 +08:00
|
|
|
r->headers_in.content_length->value.len);
|
|
|
|
|
|
|
|
if (r->headers_in.content_length_n == NGX_ERROR) {
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
|
|
|
"client sent invalid \"Content-Length\" header");
|
2005-11-26 18:11:11 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED);
|
2005-03-28 22:43:02 +08:00
|
|
|
return NGX_ERROR;
|
2003-10-22 00:49:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-21 20:06:44 +08:00
|
|
|
if (r->method & (NGX_HTTP_POST|NGX_HTTP_PUT)
|
|
|
|
&& r->headers_in.content_length_n == -1)
|
|
|
|
{
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
2007-12-30 17:11:19 +08:00
|
|
|
"client sent %V method without \"Content-Length\" header",
|
|
|
|
&r->method_name);
|
2005-11-26 18:11:11 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED);
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
2007-09-07 17:29:08 +08:00
|
|
|
if (r->method & NGX_HTTP_TRACE) {
|
2007-03-31 02:59:26 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
|
|
|
"client sent TRACE method");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-11-26 18:11:11 +08:00
|
|
|
if (r->headers_in.transfer_encoding
|
2007-09-27 03:26:14 +08:00
|
|
|
&& ngx_strcasestrn(r->headers_in.transfer_encoding->value.data,
|
2007-10-01 20:57:47 +08:00
|
|
|
"chunked", 7 - 1))
|
2005-11-26 18:11:11 +08:00
|
|
|
{
|
|
|
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
|
|
|
"client sent \"Transfer-Encoding: chunked\" header");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED);
|
2005-03-28 22:43:02 +08:00
|
|
|
return NGX_ERROR;
|
2004-03-30 14:27:36 +08:00
|
|
|
}
|
|
|
|
|
2007-09-10 02:28:49 +08:00
|
|
|
if (r->headers_in.connection_type == NGX_HTTP_CONNECTION_KEEP_ALIVE) {
|
|
|
|
if (r->headers_in.keep_alive) {
|
|
|
|
r->headers_in.keep_alive_n =
|
|
|
|
ngx_atotm(r->headers_in.keep_alive->value.data,
|
|
|
|
r->headers_in.keep_alive->value.len);
|
2003-10-22 00:49:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-05 04:40:03 +08:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
ngx_http_process_request(ngx_http_request_t *r)
|
|
|
|
{
|
2007-12-10 20:09:51 +08:00
|
|
|
ngx_connection_t *c;
|
2007-06-05 04:40:03 +08:00
|
|
|
|
|
|
|
c = r->connection;
|
|
|
|
|
2007-12-01 19:46:04 +08:00
|
|
|
if (r->plain_http) {
|
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
|
|
|
"client sent plain HTTP request to HTTPS port");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-08-05 00:04:04 +08:00
|
|
|
#if (NGX_HTTP_SSL)
|
|
|
|
|
2007-06-05 04:40:03 +08:00
|
|
|
if (c->ssl) {
|
2007-12-10 20:09:51 +08:00
|
|
|
long rc;
|
2008-04-24 02:57:25 +08:00
|
|
|
X509 *cert;
|
2007-12-10 20:09:51 +08:00
|
|
|
ngx_http_ssl_srv_conf_t *sscf;
|
|
|
|
|
2006-08-05 00:04:04 +08:00
|
|
|
sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module);
|
|
|
|
|
2008-07-29 22:29:02 +08:00
|
|
|
if (sscf->verify == 1) {
|
2007-06-05 04:40:03 +08:00
|
|
|
rc = SSL_get_verify_result(c->ssl->connection);
|
2006-08-05 00:04:04 +08:00
|
|
|
|
|
|
|
if (rc != X509_V_OK) {
|
2007-06-05 04:40:03 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
2006-08-10 03:59:45 +08:00
|
|
|
"client SSL certificate verify error: (%l:%s)",
|
2006-08-05 00:04:04 +08:00
|
|
|
rc, X509_verify_cert_error_string(rc));
|
2008-03-10 22:47:07 +08:00
|
|
|
|
|
|
|
ngx_ssl_remove_cached_session(sscf->ssl.ctx,
|
|
|
|
(SSL_get0_session(c->ssl->connection)));
|
|
|
|
|
2006-08-05 00:04:04 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTPS_CERT_ERROR);
|
2007-06-05 04:40:03 +08:00
|
|
|
return;
|
2006-08-05 00:04:04 +08:00
|
|
|
}
|
|
|
|
|
2008-04-24 02:57:25 +08:00
|
|
|
cert = SSL_get_peer_certificate(c->ssl->connection);
|
|
|
|
|
|
|
|
if (cert == NULL) {
|
2007-06-05 04:40:03 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
2006-08-05 00:04:04 +08:00
|
|
|
"client sent no required SSL certificate");
|
2008-03-10 22:47:07 +08:00
|
|
|
|
|
|
|
ngx_ssl_remove_cached_session(sscf->ssl.ctx,
|
|
|
|
(SSL_get0_session(c->ssl->connection)));
|
|
|
|
|
2006-08-05 00:04:04 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTPS_NO_CERT);
|
2007-06-05 04:40:03 +08:00
|
|
|
return;
|
2006-08-05 00:04:04 +08:00
|
|
|
}
|
2008-04-24 02:57:25 +08:00
|
|
|
|
|
|
|
X509_free(cert);
|
2006-08-05 00:04:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2007-06-05 04:40:03 +08:00
|
|
|
if (c->read->timer_set) {
|
|
|
|
ngx_del_timer(c->read);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if (NGX_STAT_STUB)
|
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
|
|
|
r->stat_reading = 0;
|
|
|
|
ngx_atomic_fetch_add(ngx_stat_writing, 1);
|
|
|
|
r->stat_writing = 1;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
c->read->handler = ngx_http_request_handler;
|
|
|
|
c->write->handler = ngx_http_request_handler;
|
2007-08-06 23:22:40 +08:00
|
|
|
r->read_event_handler = ngx_http_block_reading;
|
2007-06-05 04:40:03 +08:00
|
|
|
|
|
|
|
ngx_http_handler(r);
|
|
|
|
|
|
|
|
return;
|
2003-10-22 00:49:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
static ssize_t
|
|
|
|
ngx_http_validate_host(u_char *host, size_t len)
|
2004-12-21 20:30:30 +08:00
|
|
|
{
|
2008-05-15 22:44:47 +08:00
|
|
|
u_char ch;
|
|
|
|
size_t i, last;
|
|
|
|
ngx_uint_t dot;
|
|
|
|
|
|
|
|
last = len;
|
|
|
|
dot = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++) {
|
|
|
|
ch = host[i];
|
|
|
|
|
|
|
|
if (ch == '.') {
|
|
|
|
if (dot) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
dot = 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
dot = 0;
|
|
|
|
|
|
|
|
if (ch == ':') {
|
|
|
|
last = i;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ch == '/' || ch == '\0') {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if (NGX_WIN32)
|
|
|
|
if (ch == '\\') {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dot) {
|
|
|
|
last--;
|
|
|
|
}
|
|
|
|
|
|
|
|
return last;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
|
|
|
|
{
|
2008-08-04 18:18:36 +08:00
|
|
|
u_char *server;
|
|
|
|
ngx_uint_t hash;
|
2005-12-27 01:07:48 +08:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2008-05-15 22:44:47 +08:00
|
|
|
u_char buf[32];
|
2004-12-21 20:30:30 +08:00
|
|
|
|
2008-08-21 20:56:10 +08:00
|
|
|
if (r->virtual_names == NULL) {
|
2008-05-15 22:44:47 +08:00
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (len <= 32) {
|
|
|
|
server = buf;
|
|
|
|
|
|
|
|
} else {
|
2008-06-17 23:00:30 +08:00
|
|
|
server = ngx_pnalloc(r->pool, len);
|
2008-05-15 22:44:47 +08:00
|
|
|
if (server == NULL) {
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-04 18:18:36 +08:00
|
|
|
hash = ngx_hash_strlow(server, host, len);
|
2008-05-15 22:44:47 +08:00
|
|
|
|
|
|
|
cscf = ngx_hash_find_combined(&r->virtual_names->names, hash, server, len);
|
2004-12-21 20:30:30 +08:00
|
|
|
|
2007-06-12 03:49:22 +08:00
|
|
|
if (cscf) {
|
|
|
|
goto found;
|
2004-12-21 20:30:30 +08:00
|
|
|
}
|
|
|
|
|
2007-08-13 03:48:12 +08:00
|
|
|
#if (NGX_PCRE)
|
|
|
|
|
|
|
|
if (r->virtual_names->nregex) {
|
2007-12-10 20:09:51 +08:00
|
|
|
ngx_int_t n;
|
|
|
|
ngx_uint_t i;
|
|
|
|
ngx_str_t name;
|
|
|
|
ngx_http_server_name_t *sn;
|
2007-08-13 03:48:12 +08:00
|
|
|
|
|
|
|
name.len = len;
|
2008-05-15 22:44:47 +08:00
|
|
|
name.data = server;
|
2007-08-13 03:48:12 +08:00
|
|
|
|
|
|
|
sn = r->virtual_names->regex;
|
|
|
|
|
|
|
|
for (i = 0; i < r->virtual_names->nregex; i++) {
|
|
|
|
|
|
|
|
n = ngx_regex_exec(sn[i].regex, &name, NULL, 0);
|
|
|
|
|
|
|
|
if (n == NGX_REGEX_NO_MATCHED) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (n < 0) {
|
|
|
|
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
|
|
|
|
ngx_regex_exec_n
|
|
|
|
" failed: %d on \"%V\" using \"%V\"",
|
|
|
|
n, &name, &sn[i].name);
|
2008-05-15 22:44:47 +08:00
|
|
|
return NGX_ERROR;
|
2007-08-13 03:48:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* match */
|
|
|
|
|
|
|
|
cscf = sn[i].core_srv_conf;
|
|
|
|
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
return NGX_OK;
|
2004-12-21 20:30:30 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
found:
|
|
|
|
|
2005-12-27 01:07:48 +08:00
|
|
|
r->srv_conf = cscf->ctx->srv_conf;
|
|
|
|
r->loc_conf = cscf->ctx->loc_conf;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
r->connection->log->file = clcf->err_log->file;
|
|
|
|
|
|
|
|
if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
|
|
|
|
r->connection->log->log_level = clcf->err_log->log_level;
|
2004-12-21 20:30:30 +08:00
|
|
|
}
|
|
|
|
|
2008-05-15 22:44:47 +08:00
|
|
|
return NGX_OK;
|
2004-12-21 20:30:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
static void
|
|
|
|
ngx_http_request_handler(ngx_event_t *ev)
|
|
|
|
{
|
|
|
|
ngx_connection_t *c;
|
|
|
|
ngx_http_request_t *r;
|
2006-07-11 21:20:19 +08:00
|
|
|
ngx_http_log_ctx_t *ctx;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
|
|
|
c = ev->data;
|
|
|
|
r = c->data;
|
|
|
|
|
2006-07-11 21:20:19 +08:00
|
|
|
ctx = c->log->data;
|
|
|
|
ctx->current_request = r;
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (ev->write) {
|
|
|
|
r->write_event_handler(r);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
r->read_event_handler(r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
void
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
|
2002-12-11 02:05:12 +08:00
|
|
|
{
|
2007-08-27 23:53:00 +08:00
|
|
|
ngx_connection_t *c;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_http_request_t *pr;
|
2006-07-11 21:20:19 +08:00
|
|
|
ngx_http_log_ctx_t *ctx;
|
2003-12-15 04:10:27 +08:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (rc == NGX_DONE) {
|
2005-10-24 23:09:41 +08:00
|
|
|
/* the request pool may be already destroyed */
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
c = r->connection;
|
|
|
|
|
|
|
|
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2005-12-05 21:18:09 +08:00
|
|
|
"http finalize request: %d, \"%V?%V\"",
|
|
|
|
rc, &r->uri, &r->args);
|
2002-12-11 02:05:12 +08:00
|
|
|
|
2006-08-30 18:39:17 +08:00
|
|
|
if (rc == NGX_DECLINED) {
|
|
|
|
r->content_handler = NULL;
|
|
|
|
r->write_event_handler = ngx_http_core_run_phases;
|
|
|
|
ngx_http_core_run_phases(r);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-10-13 23:20:10 +08:00
|
|
|
if (r != r->main && r->post_subrequest) {
|
|
|
|
rc = r->post_subrequest->handler(r, r->post_subrequest->data, rc);
|
2006-07-28 23:16:17 +08:00
|
|
|
}
|
|
|
|
|
2007-12-27 21:13:34 +08:00
|
|
|
if (rc == NGX_ERROR
|
|
|
|
|| rc == NGX_HTTP_REQUEST_TIME_OUT
|
|
|
|
|| rc == NGX_HTTP_CLIENT_CLOSED_REQUEST
|
|
|
|
|| c->error)
|
|
|
|
{
|
2007-01-29 19:53:23 +08:00
|
|
|
if (rc > 0 && r->headers_out.status == 0) {
|
|
|
|
r->headers_out.status = rc;
|
2006-04-26 17:52:47 +08:00
|
|
|
}
|
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
if (ngx_http_post_action(r) == NGX_OK) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-04-19 23:30:56 +08:00
|
|
|
if (rc >= NGX_HTTP_SPECIAL_RESPONSE
|
|
|
|
|| rc == NGX_HTTP_CREATED
|
|
|
|
|| rc == NGX_HTTP_NO_CONTENT)
|
|
|
|
{
|
2005-12-07 22:51:31 +08:00
|
|
|
if (rc == NGX_HTTP_CLOSE) {
|
|
|
|
ngx_http_close_request(r, rc);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-01-11 23:26:57 +08:00
|
|
|
if (r == r->main) {
|
2007-08-27 23:53:00 +08:00
|
|
|
if (c->read->timer_set) {
|
|
|
|
ngx_del_timer(c->read);
|
2005-10-24 23:09:41 +08:00
|
|
|
}
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
if (c->write->timer_set) {
|
|
|
|
ngx_del_timer(c->write);
|
2005-10-24 23:09:41 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
|
2003-10-09 15:00:45 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-01-11 23:26:57 +08:00
|
|
|
if (r != r->main || rc == NGX_AGAIN) {
|
2005-06-23 21:41:06 +08:00
|
|
|
if (ngx_http_set_write_handler(r) != NGX_OK) {
|
|
|
|
return;
|
|
|
|
}
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
}
|
|
|
|
|
2007-12-27 22:39:05 +08:00
|
|
|
r->done = 1;
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
if (r != c->data) {
|
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2005-12-05 21:18:09 +08:00
|
|
|
"http finalize non-active request: \"%V?%V\"",
|
|
|
|
&r->uri, &r->args);
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-01-11 23:26:57 +08:00
|
|
|
if (r != r->main) {
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
|
|
|
pr = r->parent;
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2005-12-05 21:18:09 +08:00
|
|
|
"http parent request: \"%V?%V\"", &pr->uri, &pr->args);
|
2005-07-08 22:34:20 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (rc != NGX_AGAIN) {
|
2007-08-27 23:53:00 +08:00
|
|
|
c->data = pr;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
}
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
ctx = c->log->data;
|
2006-07-11 21:20:19 +08:00
|
|
|
ctx->current_request = pr;
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (pr->postponed) {
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2005-12-05 21:18:09 +08:00
|
|
|
"http request: \"%V?%V\" has postponed",
|
|
|
|
&pr->uri, &pr->args);
|
2005-07-08 22:34:20 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (rc != NGX_AGAIN && pr->postponed->request == r) {
|
|
|
|
pr->postponed = pr->postponed->next;
|
2006-01-11 23:26:57 +08:00
|
|
|
}
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
2006-01-11 23:26:57 +08:00
|
|
|
if (r->fast_subrequest) {
|
2006-05-04 23:32:46 +08:00
|
|
|
|
|
|
|
if (rc == NGX_AGAIN) {
|
|
|
|
r->fast_subrequest = 0;
|
|
|
|
}
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2007-12-25 23:31:18 +08:00
|
|
|
"http fast subrequest: \"%V?%V\" done",
|
|
|
|
&r->uri, &r->args);
|
2006-01-11 23:26:57 +08:00
|
|
|
return;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
}
|
|
|
|
|
2006-05-04 23:32:46 +08:00
|
|
|
if (rc != NGX_AGAIN) {
|
2007-08-27 23:53:00 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2006-05-04 23:32:46 +08:00
|
|
|
"http wake parent request: \"%V?%V\"",
|
|
|
|
&pr->uri, &pr->args);
|
2006-01-11 23:26:57 +08:00
|
|
|
|
2006-05-04 23:32:46 +08:00
|
|
|
pr->write_event_handler(pr);
|
|
|
|
}
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2003-10-27 16:53:49 +08:00
|
|
|
|
2005-10-24 23:09:41 +08:00
|
|
|
if (rc == NGX_AGAIN) {
|
2003-10-10 23:10:50 +08:00
|
|
|
return;
|
2005-07-08 22:34:20 +08:00
|
|
|
}
|
2003-10-09 15:00:45 +08:00
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
if (c->buffered) {
|
2005-06-23 21:41:06 +08:00
|
|
|
(void) ngx_http_set_write_handler(r);
|
2003-10-10 23:10:50 +08:00
|
|
|
return;
|
2003-03-21 00:09:44 +08:00
|
|
|
}
|
2002-12-11 02:05:12 +08:00
|
|
|
|
2006-04-05 21:40:54 +08:00
|
|
|
if (!r->post_action) {
|
|
|
|
r->request_complete = 1;
|
|
|
|
}
|
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
if (ngx_http_post_action(r) == NGX_OK) {
|
2005-11-15 21:30:52 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
if (c->read->timer_set) {
|
|
|
|
ngx_del_timer(c->read);
|
2003-05-14 00:02:32 +08:00
|
|
|
}
|
2002-12-11 02:05:12 +08:00
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
if (c->write->timer_set) {
|
|
|
|
c->write->delayed = 0;
|
|
|
|
ngx_del_timer(c->write);
|
2003-05-14 00:02:32 +08:00
|
|
|
}
|
2002-12-11 02:05:12 +08:00
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
if (c->destroyed) {
|
2005-12-16 23:07:08 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-08-27 23:53:00 +08:00
|
|
|
if (c->read->eof) {
|
2007-08-27 23:40:19 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
2004-01-06 04:55:48 +08:00
|
|
|
|
2004-01-16 14:15:48 +08:00
|
|
|
if (!ngx_terminate
|
2004-04-26 04:13:21 +08:00
|
|
|
&& !ngx_exiting
|
2008-05-22 01:39:51 +08:00
|
|
|
&& r->keepalive
|
2004-01-16 14:15:48 +08:00
|
|
|
&& clcf->keepalive_timeout > 0)
|
|
|
|
{
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_set_keepalive(r);
|
2004-01-16 14:15:48 +08:00
|
|
|
return;
|
2002-12-11 02:05:12 +08:00
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
} else if (r->lingering_close && clcf->lingering_timeout > 0) {
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_set_lingering_close(r);
|
2004-01-16 14:15:48 +08:00
|
|
|
return;
|
2003-03-21 00:09:44 +08:00
|
|
|
}
|
2003-10-09 15:00:45 +08:00
|
|
|
|
2004-01-16 14:15:48 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
2003-05-14 00:02:32 +08:00
|
|
|
}
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2005-06-23 21:41:06 +08:00
|
|
|
static ngx_int_t
|
2005-03-19 20:38:37 +08:00
|
|
|
ngx_http_set_write_handler(ngx_http_request_t *r)
|
2003-05-14 00:02:32 +08:00
|
|
|
{
|
|
|
|
ngx_event_t *wev;
|
2003-05-20 00:39:14 +08:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
2003-03-21 00:09:44 +08:00
|
|
|
|
2004-06-25 22:42:03 +08:00
|
|
|
r->http_state = NGX_HTTP_WRITING_REQUEST_STATE;
|
|
|
|
|
2007-08-06 23:22:40 +08:00
|
|
|
r->read_event_handler = ngx_http_test_reading;
|
2005-06-23 21:41:06 +08:00
|
|
|
r->write_event_handler = ngx_http_writer;
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
wev = r->connection->write;
|
|
|
|
|
2004-06-21 23:59:32 +08:00
|
|
|
if (wev->ready && wev->delayed) {
|
2005-06-23 21:41:06 +08:00
|
|
|
return NGX_OK;
|
2003-04-18 01:59:35 +08:00
|
|
|
}
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
2004-06-21 23:59:32 +08:00
|
|
|
if (!wev->delayed) {
|
2004-06-21 03:54:15 +08:00
|
|
|
ngx_add_timer(wev, clcf->send_timeout);
|
|
|
|
}
|
2003-02-07 01:21:13 +08:00
|
|
|
|
2004-10-11 23:07:03 +08:00
|
|
|
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
2003-10-10 23:10:50 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
2005-06-23 21:41:06 +08:00
|
|
|
return NGX_ERROR;
|
2003-10-10 23:10:50 +08:00
|
|
|
}
|
2005-06-23 21:41:06 +08:00
|
|
|
|
|
|
|
return NGX_OK;
|
2002-12-11 02:05:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
static void
|
|
|
|
ngx_http_writer(ngx_http_request_t *r)
|
2002-12-15 14:25:09 +08:00
|
|
|
{
|
2003-03-21 00:09:44 +08:00
|
|
|
int rc;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_event_t *wev;
|
2002-12-15 14:25:09 +08:00
|
|
|
ngx_connection_t *c;
|
2003-05-27 20:18:54 +08:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
2002-12-15 14:25:09 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
c = r->connection;
|
|
|
|
wev = c->write;
|
2003-11-20 00:26:41 +08:00
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, wev->log, 0,
|
|
|
|
"http writer handler: \"%V?%V\"", &r->uri, &r->args);
|
2002-12-15 14:25:09 +08:00
|
|
|
|
2003-10-27 16:53:49 +08:00
|
|
|
if (wev->timedout) {
|
2004-06-21 23:59:32 +08:00
|
|
|
if (!wev->delayed) {
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
|
|
|
|
"client timed out");
|
|
|
|
c->timedout = 1;
|
2005-10-22 03:12:18 +08:00
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);
|
2004-06-21 03:54:15 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
wev->timedout = 0;
|
2004-06-21 23:59:32 +08:00
|
|
|
wev->delayed = 0;
|
2004-06-21 03:54:15 +08:00
|
|
|
|
|
|
|
if (!wev->ready) {
|
2005-10-04 18:38:53 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r->main, ngx_http_core_module);
|
2004-06-21 03:54:15 +08:00
|
|
|
ngx_add_timer(wev, clcf->send_timeout);
|
|
|
|
|
2004-10-11 23:07:03 +08:00
|
|
|
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
2004-06-21 03:54:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2004-06-21 23:59:32 +08:00
|
|
|
if (wev->delayed) {
|
2004-06-21 03:54:15 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, wev->log, 0,
|
|
|
|
"http writer delayed");
|
2004-06-21 23:59:32 +08:00
|
|
|
|
2005-10-04 18:38:53 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r->main, ngx_http_core_module);
|
2004-06-21 23:59:32 +08:00
|
|
|
|
2004-10-11 23:07:03 +08:00
|
|
|
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
2004-06-21 23:59:32 +08:00
|
|
|
}
|
|
|
|
|
2004-06-21 03:54:15 +08:00
|
|
|
return;
|
|
|
|
}
|
2003-10-27 16:53:49 +08:00
|
|
|
}
|
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
rc = ngx_http_output_filter(r, NULL);
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
if (c->destroyed) {
|
|
|
|
return;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
}
|
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
|
|
|
"http writer output filter: %d, \"%V?%V\"",
|
|
|
|
rc, &r->uri, &r->args);
|
2002-12-15 14:25:09 +08:00
|
|
|
|
|
|
|
if (rc == NGX_AGAIN) {
|
2005-10-04 18:38:53 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r->main, ngx_http_core_module);
|
2004-06-21 23:59:32 +08:00
|
|
|
if (!wev->ready && !wev->delayed) {
|
2003-10-13 00:49:16 +08:00
|
|
|
ngx_add_timer(wev, clcf->send_timeout);
|
2002-12-15 14:25:09 +08:00
|
|
|
}
|
|
|
|
|
2004-10-11 23:07:03 +08:00
|
|
|
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
2003-10-13 00:49:16 +08:00
|
|
|
}
|
2002-12-15 14:25:09 +08:00
|
|
|
|
2006-10-31 04:25:22 +08:00
|
|
|
if (r == r->main || r->buffered) {
|
2006-01-11 23:26:57 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
rc = NGX_OK;
|
2003-05-14 00:02:32 +08:00
|
|
|
}
|
2002-12-15 14:25:09 +08:00
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, wev->log, 0,
|
|
|
|
"http writer done: \"%V?%V\"", &r->uri, &r->args);
|
2002-12-15 14:25:09 +08:00
|
|
|
|
2003-10-13 00:49:16 +08:00
|
|
|
ngx_http_finalize_request(r, rc);
|
2003-05-12 23:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-06 23:22:40 +08:00
|
|
|
void
|
|
|
|
ngx_http_block_reading(ngx_http_request_t *r)
|
2007-07-11 04:53:45 +08:00
|
|
|
{
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2007-08-06 23:22:40 +08:00
|
|
|
"http reading blocked");
|
2007-07-11 04:53:45 +08:00
|
|
|
|
|
|
|
/* aio does not call this handler */
|
|
|
|
|
|
|
|
if ((ngx_event_flags & NGX_USE_LEVEL_EVENT)
|
|
|
|
&& r->connection->read->active)
|
|
|
|
{
|
|
|
|
if (ngx_del_event(r->connection->read, NGX_READ_EVENT, 0)
|
|
|
|
== NGX_ERROR)
|
|
|
|
{
|
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2007-08-06 23:22:40 +08:00
|
|
|
ngx_http_test_reading(ngx_http_request_t *r)
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
{
|
2007-01-19 16:10:06 +08:00
|
|
|
int n;
|
|
|
|
char buf[1];
|
|
|
|
ngx_err_t err;
|
|
|
|
ngx_event_t *rev;
|
|
|
|
ngx_connection_t *c;
|
|
|
|
|
|
|
|
c = r->connection;
|
|
|
|
rev = c->read;
|
|
|
|
|
2007-08-06 23:22:40 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http test reading");
|
2007-01-19 16:10:06 +08:00
|
|
|
|
|
|
|
#if (NGX_HAVE_KQUEUE)
|
|
|
|
|
|
|
|
if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
|
|
|
|
|
|
|
|
if (!rev->pending_eof) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
rev->eof = 1;
|
|
|
|
c->error = 1;
|
|
|
|
err = rev->kq_errno;
|
|
|
|
|
|
|
|
goto closed;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
n = recv(c->fd, buf, 1, MSG_PEEK);
|
|
|
|
|
|
|
|
if (n == 0) {
|
|
|
|
rev->eof = 1;
|
|
|
|
c->error = 1;
|
|
|
|
err = 0;
|
|
|
|
|
|
|
|
goto closed;
|
|
|
|
|
|
|
|
} else if (n == -1) {
|
|
|
|
err = ngx_socket_errno;
|
|
|
|
|
|
|
|
if (err != NGX_EAGAIN) {
|
|
|
|
rev->eof = 1;
|
|
|
|
c->error = 1;
|
|
|
|
|
|
|
|
goto closed;
|
|
|
|
}
|
|
|
|
}
|
2002-12-11 02:05:12 +08:00
|
|
|
|
2003-02-07 01:21:13 +08:00
|
|
|
/* aio does not call this handler */
|
|
|
|
|
2007-01-19 16:10:06 +08:00
|
|
|
if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && rev->active) {
|
|
|
|
|
|
|
|
if (ngx_del_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
|
2003-05-15 23:42:53 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
}
|
2003-02-07 01:21:13 +08:00
|
|
|
}
|
2007-01-19 16:10:06 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
closed:
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
rev->error = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, err,
|
|
|
|
"client closed prematurely connection");
|
|
|
|
|
2007-02-16 02:53:48 +08:00
|
|
|
ngx_http_finalize_request(r, 0);
|
2003-05-14 00:02:32 +08:00
|
|
|
}
|
|
|
|
|
2003-05-15 23:42:53 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static void
|
|
|
|
ngx_http_set_keepalive(ngx_http_request_t *r)
|
2003-02-11 15:14:40 +08:00
|
|
|
{
|
2004-10-11 23:07:03 +08:00
|
|
|
int tcp_nodelay;
|
2004-09-23 14:32:00 +08:00
|
|
|
ngx_int_t i;
|
|
|
|
ngx_buf_t *b, *f;
|
2003-05-23 19:53:01 +08:00
|
|
|
ngx_event_t *rev, *wev;
|
|
|
|
ngx_connection_t *c;
|
2004-09-21 13:38:28 +08:00
|
|
|
ngx_http_connection_t *hc;
|
2003-05-23 19:53:01 +08:00
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
2003-02-11 15:14:40 +08:00
|
|
|
|
2003-05-27 20:18:54 +08:00
|
|
|
c = r->connection;
|
2003-03-05 14:37:42 +08:00
|
|
|
rev = c->read;
|
2003-02-11 15:14:40 +08:00
|
|
|
|
2007-08-07 18:53:27 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
2004-01-26 16:52:49 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler");
|
2003-05-22 23:23:47 +08:00
|
|
|
|
2007-08-07 18:53:27 +08:00
|
|
|
if (r->discard_body) {
|
|
|
|
r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000);
|
|
|
|
ngx_add_timer(rev, clcf->lingering_timeout);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->action = "closing request";
|
2004-09-21 13:38:28 +08:00
|
|
|
|
|
|
|
hc = r->http_connection;
|
2004-09-23 14:32:00 +08:00
|
|
|
b = r->header_in;
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
if (b->pos < b->last) {
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
/* the pipelined request */
|
2004-09-23 14:32:00 +08:00
|
|
|
|
|
|
|
if (b != c->buffer) {
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
/*
|
|
|
|
* If the large header buffers were allocated while the previous
|
|
|
|
* request processing then we do not use c->buffer for
|
|
|
|
* the pipelined request (see ngx_http_init_request()).
|
2005-11-15 21:30:52 +08:00
|
|
|
*
|
2004-10-21 23:34:38 +08:00
|
|
|
* Now we would move the large header buffers to the free list.
|
|
|
|
*/
|
2004-09-23 14:32:00 +08:00
|
|
|
|
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
if (hc->free == NULL) {
|
|
|
|
hc->free = ngx_palloc(c->pool,
|
|
|
|
cscf->large_client_header_buffers.num * sizeof(ngx_buf_t *));
|
2004-09-24 00:39:34 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
if (hc->free == NULL) {
|
2004-12-21 20:30:30 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
2004-09-23 14:32:00 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < hc->nbusy - 1; i++) {
|
|
|
|
f = hc->busy[i];
|
|
|
|
hc->free[hc->nfree++] = f;
|
|
|
|
f->pos = f->start;
|
|
|
|
f->last = f->start;
|
|
|
|
}
|
|
|
|
|
|
|
|
hc->busy[0] = b;
|
|
|
|
hc->nbusy = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_request_done(r, 0);
|
|
|
|
|
2004-09-21 13:38:28 +08:00
|
|
|
c->data = hc;
|
2003-03-12 04:38:13 +08:00
|
|
|
|
2003-05-21 21:28:21 +08:00
|
|
|
ngx_add_timer(rev, clcf->keepalive_timeout);
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
2003-10-13 00:49:16 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2003-03-12 04:38:13 +08:00
|
|
|
}
|
2003-02-11 15:14:40 +08:00
|
|
|
|
2004-02-13 04:57:10 +08:00
|
|
|
wev = c->write;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
wev->handler = ngx_http_empty_handler;
|
2003-03-05 14:37:42 +08:00
|
|
|
|
2004-05-28 23:49:23 +08:00
|
|
|
if (b->pos < b->last) {
|
2003-03-05 14:37:42 +08:00
|
|
|
|
2004-01-26 16:52:49 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "pipelined request");
|
2003-05-27 20:18:54 +08:00
|
|
|
|
2005-10-22 03:12:18 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
|
|
|
#endif
|
|
|
|
|
2004-09-21 13:38:28 +08:00
|
|
|
hc->pipeline = 1;
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->action = "reading client pipelined request line";
|
2005-10-22 03:12:18 +08:00
|
|
|
|
2008-05-19 18:24:22 +08:00
|
|
|
rev->handler = ngx_http_init_request;
|
|
|
|
ngx_post_event(rev, &ngx_posted_events);
|
2003-05-14 00:02:32 +08:00
|
|
|
return;
|
2003-03-05 14:37:42 +08:00
|
|
|
}
|
|
|
|
|
2004-09-21 13:38:28 +08:00
|
|
|
hc->pipeline = 0;
|
2003-03-05 14:37:42 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
/*
|
|
|
|
* To keep a memory footprint as small as possible for an idle
|
|
|
|
* keepalive connection we try to free the ngx_http_request_t and
|
|
|
|
* c->buffer's memory if they were allocated outside the c->pool.
|
|
|
|
* The large header buffers are always allocated outside the c->pool and
|
|
|
|
* are freed too.
|
|
|
|
*/
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
if (ngx_pfree(c->pool, r) == NGX_OK) {
|
|
|
|
hc->request = NULL;
|
|
|
|
}
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
b = c->buffer;
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
if (ngx_pfree(c->pool, b->start) == NGX_OK) {
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* the special note for ngx_http_keepalive_handler() that
|
|
|
|
* c->buffer's memory was freed
|
|
|
|
*/
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
b->pos = NULL;
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
} else {
|
|
|
|
b->pos = b->start;
|
|
|
|
b->last = b->start;
|
|
|
|
}
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc free: %p %d",
|
2004-09-24 00:39:34 +08:00
|
|
|
hc->free, hc->nfree);
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
if (hc->free) {
|
|
|
|
for (i = 0; i < hc->nfree; i++) {
|
2007-12-12 23:42:39 +08:00
|
|
|
ngx_pfree(c->pool, hc->free[i]->start);
|
2004-09-24 00:39:34 +08:00
|
|
|
hc->free[i] = NULL;
|
2004-09-23 14:32:00 +08:00
|
|
|
}
|
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
hc->nfree = 0;
|
|
|
|
}
|
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc busy: %p %d",
|
2004-09-24 00:39:34 +08:00
|
|
|
hc->busy, hc->nbusy);
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
if (hc->busy) {
|
|
|
|
for (i = 0; i < hc->nbusy; i++) {
|
2007-12-12 23:42:39 +08:00
|
|
|
ngx_pfree(c->pool, hc->busy[i]->start);
|
2004-09-24 00:39:34 +08:00
|
|
|
hc->busy[i] = NULL;
|
2004-09-23 14:32:00 +08:00
|
|
|
}
|
2004-09-24 00:39:34 +08:00
|
|
|
|
|
|
|
hc->nbusy = 0;
|
2004-09-23 14:32:00 +08:00
|
|
|
}
|
|
|
|
|
2007-12-27 05:07:30 +08:00
|
|
|
#if (NGX_HTTP_SSL)
|
|
|
|
if (c->ssl) {
|
|
|
|
ngx_ssl_free_buffer(c);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler = ngx_http_keepalive_handler;
|
2003-03-05 14:37:42 +08:00
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
if (wev->active && (ngx_event_flags & NGX_USE_LEVEL_EVENT)) {
|
|
|
|
if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) {
|
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2003-03-05 14:37:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->action = "keepalive";
|
2003-06-05 01:28:33 +08:00
|
|
|
|
2004-06-01 14:04:46 +08:00
|
|
|
if (c->tcp_nopush == NGX_TCP_NOPUSH_SET) {
|
2005-03-19 20:38:37 +08:00
|
|
|
if (ngx_tcp_push(c->fd) == -1) {
|
2004-04-28 14:14:50 +08:00
|
|
|
ngx_connection_error(c, ngx_socket_errno, ngx_tcp_push_n " failed");
|
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2003-06-05 01:28:33 +08:00
|
|
|
}
|
2004-10-11 23:07:03 +08:00
|
|
|
|
2004-06-01 14:04:46 +08:00
|
|
|
c->tcp_nopush = NGX_TCP_NOPUSH_UNSET;
|
2004-12-03 02:40:46 +08:00
|
|
|
tcp_nodelay = ngx_tcp_nodelay_and_tcp_nopush ? 1 : 0;
|
2004-10-11 23:07:03 +08:00
|
|
|
|
|
|
|
} else {
|
2004-12-03 02:40:46 +08:00
|
|
|
tcp_nodelay = 1;
|
|
|
|
}
|
2004-10-11 23:07:03 +08:00
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
if (tcp_nodelay
|
|
|
|
&& clcf->tcp_nodelay
|
|
|
|
&& c->tcp_nodelay == NGX_TCP_NODELAY_UNSET)
|
|
|
|
{
|
2004-12-03 02:40:46 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
|
2004-10-11 23:07:03 +08:00
|
|
|
|
2004-12-03 02:40:46 +08:00
|
|
|
if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
|
2006-04-18 03:55:41 +08:00
|
|
|
(const void *) &tcp_nodelay, sizeof(int))
|
|
|
|
== -1)
|
2004-12-03 02:40:46 +08:00
|
|
|
{
|
|
|
|
ngx_connection_error(c, ngx_socket_errno,
|
|
|
|
"setsockopt(TCP_NODELAY) failed");
|
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2004-10-11 23:07:03 +08:00
|
|
|
}
|
2004-12-03 02:40:46 +08:00
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
c->tcp_nodelay = NGX_TCP_NODELAY_SET;
|
2003-06-05 01:28:33 +08:00
|
|
|
}
|
2003-03-04 14:33:48 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
#if 0
|
2004-10-21 23:34:38 +08:00
|
|
|
/* if ngx_http_request_t was freed then we need some other place */
|
2004-06-24 15:53:37 +08:00
|
|
|
r->http_state = NGX_HTTP_KEEPALIVE_STATE;
|
2004-09-23 14:32:00 +08:00
|
|
|
#endif
|
2004-06-24 15:53:37 +08:00
|
|
|
|
2007-03-19 21:20:15 +08:00
|
|
|
c->idle = 1;
|
|
|
|
|
2003-10-29 16:30:44 +08:00
|
|
|
if (rev->ready) {
|
2008-05-19 18:24:22 +08:00
|
|
|
ngx_post_event(rev, &ngx_posted_events);
|
2003-03-12 04:38:13 +08:00
|
|
|
}
|
2003-02-11 15:14:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static void
|
|
|
|
ngx_http_keepalive_handler(ngx_event_t *rev)
|
2002-08-26 23:18:19 +08:00
|
|
|
{
|
2005-03-19 20:38:37 +08:00
|
|
|
size_t size;
|
|
|
|
ssize_t n;
|
|
|
|
ngx_buf_t *b;
|
|
|
|
ngx_connection_t *c;
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2004-07-16 14:33:35 +08:00
|
|
|
c = rev->data;
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2004-01-26 16:52:49 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http keepalive handler");
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2007-03-19 21:20:15 +08:00
|
|
|
if (rev->timedout || c->close) {
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2003-03-13 01:32:22 +08:00
|
|
|
}
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2004-11-26 00:17:31 +08:00
|
|
|
#if (NGX_HAVE_KQUEUE)
|
2004-09-24 00:39:34 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
|
2005-12-07 22:51:31 +08:00
|
|
|
if (rev->pending_eof) {
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->handler = NULL;
|
2004-09-24 00:39:34 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, rev->kq_errno,
|
2004-11-11 22:07:14 +08:00
|
|
|
"kevent() reported that client %V closed "
|
2005-01-25 20:27:35 +08:00
|
|
|
"keepalive connection", &c->addr_text);
|
2004-12-03 02:40:46 +08:00
|
|
|
#if (NGX_HTTP_SSL)
|
|
|
|
if (c->ssl) {
|
2005-09-30 22:41:25 +08:00
|
|
|
c->ssl->no_send_shutdown = 1;
|
2004-12-03 02:40:46 +08:00
|
|
|
}
|
|
|
|
#endif
|
2004-09-24 00:39:34 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
b = c->buffer;
|
|
|
|
size = b->end - b->start;
|
|
|
|
|
|
|
|
if (b->pos == NULL) {
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The c->buffer's memory was freed by ngx_http_set_keepalive().
|
|
|
|
* However, the c->buffer->start and c->buffer->end were not changed
|
|
|
|
* to keep the buffer size.
|
|
|
|
*/
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
b->pos = ngx_palloc(c->pool, size);
|
|
|
|
if (b->pos == NULL) {
|
2004-09-24 00:39:34 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
b->start = b->pos;
|
|
|
|
b->last = b->pos;
|
|
|
|
b->end = b->pos + size;
|
|
|
|
}
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2003-10-13 00:49:16 +08:00
|
|
|
/*
|
|
|
|
* MSIE closes a keepalive connection with RST flag
|
|
|
|
* so we ignore ECONNRESET here.
|
|
|
|
*/
|
2003-03-12 04:38:13 +08:00
|
|
|
|
2004-02-11 00:23:38 +08:00
|
|
|
c->log_error = NGX_ERROR_IGNORE_ECONNRESET;
|
2003-03-12 04:38:13 +08:00
|
|
|
ngx_set_socket_errno(0);
|
2004-07-19 03:11:20 +08:00
|
|
|
|
2004-09-24 00:39:34 +08:00
|
|
|
n = c->recv(c, b->last, size);
|
2004-02-11 00:23:38 +08:00
|
|
|
c->log_error = NGX_ERROR_INFO;
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
if (n == NGX_AGAIN) {
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
2004-12-06 22:45:08 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
}
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (n == NGX_ERROR) {
|
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2003-03-13 01:32:22 +08:00
|
|
|
}
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->handler = NULL;
|
2002-09-16 23:01:44 +08:00
|
|
|
|
2002-12-15 14:25:09 +08:00
|
|
|
if (n == 0) {
|
2003-03-21 00:09:44 +08:00
|
|
|
ngx_log_error(NGX_LOG_INFO, c->log, ngx_socket_errno,
|
2005-01-25 20:27:35 +08:00
|
|
|
"client %V closed keepalive connection", &c->addr_text);
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
return;
|
2002-09-12 22:42:29 +08:00
|
|
|
}
|
2002-08-26 23:18:19 +08:00
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
b->last += n;
|
2005-01-25 20:27:35 +08:00
|
|
|
|
2005-10-22 03:12:18 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
|
|
|
#endif
|
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
c->log->handler = ngx_http_log_error;
|
|
|
|
c->log->action = "reading client request line";
|
2002-09-16 23:01:44 +08:00
|
|
|
|
2007-03-19 21:20:15 +08:00
|
|
|
c->idle = 0;
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_init_request(rev);
|
2002-09-16 23:01:44 +08:00
|
|
|
}
|
|
|
|
|
2002-12-11 02:05:12 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static void
|
|
|
|
ngx_http_set_lingering_close(ngx_http_request_t *r)
|
2005-11-15 21:30:52 +08:00
|
|
|
{
|
2003-10-13 00:49:16 +08:00
|
|
|
ngx_event_t *rev, *wev;
|
2003-03-12 04:38:13 +08:00
|
|
|
ngx_connection_t *c;
|
2003-05-27 20:18:54 +08:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
2003-01-09 13:36:00 +08:00
|
|
|
|
2003-02-11 15:14:40 +08:00
|
|
|
c = r->connection;
|
2003-01-27 05:08:14 +08:00
|
|
|
|
2003-05-27 20:18:54 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
2003-01-09 13:36:00 +08:00
|
|
|
|
2003-10-13 00:49:16 +08:00
|
|
|
rev = c->read;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
rev->handler = ngx_http_lingering_close_handler;
|
2002-09-16 23:01:44 +08:00
|
|
|
|
2005-10-07 21:30:52 +08:00
|
|
|
r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000);
|
2003-10-13 00:49:16 +08:00
|
|
|
ngx_add_timer(rev, clcf->lingering_timeout);
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
2003-10-13 00:49:16 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
2003-01-27 05:08:14 +08:00
|
|
|
}
|
|
|
|
|
2003-10-13 00:49:16 +08:00
|
|
|
wev = c->write;
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
wev->handler = ngx_http_empty_handler;
|
2002-09-16 23:01:44 +08:00
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
if (wev->active && (ngx_event_flags & NGX_USE_LEVEL_EVENT)) {
|
|
|
|
if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) {
|
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
2002-12-24 15:09:57 +08:00
|
|
|
}
|
2003-03-12 04:38:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_shutdown_socket(c->fd, NGX_WRITE_SHUTDOWN) == -1) {
|
2004-04-28 14:14:50 +08:00
|
|
|
ngx_connection_error(c, ngx_socket_errno,
|
|
|
|
ngx_shutdown_socket_n " failed");
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
2003-02-11 15:14:40 +08:00
|
|
|
}
|
|
|
|
|
2003-10-29 16:30:44 +08:00
|
|
|
if (rev->ready) {
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_lingering_close_handler(rev);
|
2003-02-11 15:14:40 +08:00
|
|
|
}
|
2002-08-26 23:18:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static void
|
|
|
|
ngx_http_lingering_close_handler(ngx_event_t *rev)
|
2002-08-26 23:18:19 +08:00
|
|
|
{
|
2003-03-21 00:09:44 +08:00
|
|
|
ssize_t n;
|
|
|
|
ngx_msec_t timer;
|
|
|
|
ngx_connection_t *c;
|
|
|
|
ngx_http_request_t *r;
|
2003-05-27 20:18:54 +08:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
2004-09-23 14:32:00 +08:00
|
|
|
u_char buffer[NGX_HTTP_LINGERING_BUFFER_SIZE];
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2003-05-27 20:18:54 +08:00
|
|
|
c = rev->data;
|
|
|
|
r = c->data;
|
2003-01-30 15:28:09 +08:00
|
|
|
|
2004-01-26 16:52:49 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
|
|
|
"http lingering close handler");
|
2003-03-21 00:09:44 +08:00
|
|
|
|
|
|
|
if (rev->timedout) {
|
2005-11-15 21:30:52 +08:00
|
|
|
c->timedout = 1;
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
2002-12-24 15:09:57 +08:00
|
|
|
}
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2007-11-15 22:26:36 +08:00
|
|
|
timer = (ngx_msec_t) (r->lingering_time - ngx_time());
|
2002-12-24 15:09:57 +08:00
|
|
|
if (timer <= 0) {
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
2002-12-24 15:09:57 +08:00
|
|
|
}
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2003-03-21 00:09:44 +08:00
|
|
|
do {
|
2004-09-23 14:32:00 +08:00
|
|
|
n = c->recv(c, buffer, NGX_HTTP_LINGERING_BUFFER_SIZE);
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2004-01-26 16:52:49 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "lingering read: %d", n);
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2003-03-21 00:09:44 +08:00
|
|
|
if (n == NGX_ERROR || n == 0) {
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return;
|
2003-03-21 00:09:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
} while (rev->ready);
|
2002-09-13 22:47:42 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
2004-12-21 20:30:30 +08:00
|
|
|
ngx_http_close_request(r, 0);
|
2004-12-06 22:45:08 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-09-23 14:32:00 +08:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
2002-09-16 23:01:44 +08:00
|
|
|
timer *= 1000;
|
2004-09-23 14:32:00 +08:00
|
|
|
|
2003-05-27 20:18:54 +08:00
|
|
|
if (timer > clcf->lingering_timeout) {
|
|
|
|
timer = clcf->lingering_timeout;
|
2002-12-24 15:09:57 +08:00
|
|
|
}
|
2002-09-13 22:47:42 +08:00
|
|
|
|
2003-03-21 00:09:44 +08:00
|
|
|
ngx_add_timer(rev, timer);
|
2002-09-13 22:47:42 +08:00
|
|
|
}
|
|
|
|
|
2002-08-20 22:48:28 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
void
|
|
|
|
ngx_http_empty_handler(ngx_event_t *wev)
|
2003-05-22 23:23:47 +08:00
|
|
|
{
|
2004-01-26 16:52:49 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, wev->log, 0, "http empty handler");
|
2003-05-22 23:23:47 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
void
|
|
|
|
ngx_http_request_empty_handler(ngx_http_request_t *r)
|
|
|
|
{
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2005-12-05 21:18:09 +08:00
|
|
|
"http request empty handler");
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
ngx_int_t
|
2005-11-26 18:11:11 +08:00
|
|
|
ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags)
|
2003-10-09 15:00:45 +08:00
|
|
|
{
|
2004-05-28 23:49:23 +08:00
|
|
|
ngx_buf_t *b;
|
2003-10-22 00:49:56 +08:00
|
|
|
ngx_chain_t out;
|
2003-10-09 15:00:45 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
b = ngx_calloc_buf(r->pool);
|
|
|
|
if (b == NULL) {
|
2004-05-28 23:49:23 +08:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-11-26 18:11:11 +08:00
|
|
|
if (flags & NGX_HTTP_LAST) {
|
|
|
|
b->last_buf = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags & NGX_HTTP_FLUSH) {
|
|
|
|
b->flush = 1;
|
|
|
|
}
|
|
|
|
|
2004-05-28 23:49:23 +08:00
|
|
|
out.buf = b;
|
2003-10-22 00:49:56 +08:00
|
|
|
out.next = NULL;
|
2003-10-09 15:00:45 +08:00
|
|
|
|
2003-10-22 00:49:56 +08:00
|
|
|
return ngx_http_output_filter(r, &out);
|
2003-10-09 15:00:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_post_action(ngx_http_request_t *r)
|
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
if (clcf->post_action.data == NULL) {
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
2006-03-15 17:53:04 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"post action: \"%V\"", &clcf->post_action);
|
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
r->http_version = NGX_HTTP_VERSION_9;
|
|
|
|
r->header_only = 1;
|
2006-04-05 21:40:54 +08:00
|
|
|
r->post_action = 1;
|
2006-02-16 23:26:46 +08:00
|
|
|
|
2007-08-06 23:22:40 +08:00
|
|
|
r->read_event_handler = ngx_http_block_reading;
|
2006-12-11 16:31:54 +08:00
|
|
|
|
2008-02-15 20:46:40 +08:00
|
|
|
if (clcf->post_action.data[0] == '/') {
|
|
|
|
ngx_http_internal_redirect(r, &clcf->post_action, NULL);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
ngx_http_named_location(r, &clcf->post_action);
|
|
|
|
}
|
2006-02-16 23:26:46 +08:00
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
|
2003-05-14 00:02:32 +08:00
|
|
|
{
|
2006-04-21 20:06:44 +08:00
|
|
|
ngx_connection_t *c;
|
2005-10-24 23:09:41 +08:00
|
|
|
|
|
|
|
c = r->connection;
|
|
|
|
|
2006-04-21 20:06:44 +08:00
|
|
|
ngx_http_request_done(r->main, error);
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_close_connection(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
static void
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_request_done(ngx_http_request_t *r, ngx_int_t error)
|
|
|
|
{
|
|
|
|
ngx_log_t *log;
|
2005-11-26 18:11:11 +08:00
|
|
|
ngx_uint_t i, n;
|
2005-10-24 23:09:41 +08:00
|
|
|
struct linger linger;
|
2006-04-21 20:06:44 +08:00
|
|
|
ngx_http_cleanup_t *cln;
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_log_ctx_t *ctx;
|
2005-11-26 18:11:11 +08:00
|
|
|
ngx_http_handler_pt *log_handler;
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2003-12-01 04:03:18 +08:00
|
|
|
log = r->connection->log;
|
|
|
|
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http close request");
|
2003-05-14 00:02:32 +08:00
|
|
|
|
|
|
|
if (r->pool == NULL) {
|
2005-07-25 17:41:38 +08:00
|
|
|
ngx_log_error(NGX_LOG_ALERT, log, 0, "http request already closed");
|
2003-05-14 00:02:32 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-04-21 20:06:44 +08:00
|
|
|
for (cln = r->cleanup; cln; cln = cln->next) {
|
|
|
|
if (cln->handler) {
|
|
|
|
cln->handler(cln->data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-09-16 00:00:43 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
2005-10-22 03:12:18 +08:00
|
|
|
|
2004-09-16 00:00:43 +08:00
|
|
|
if (r->stat_reading) {
|
2005-10-12 21:50:36 +08:00
|
|
|
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
2004-09-16 00:00:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (r->stat_writing) {
|
2005-10-12 21:50:36 +08:00
|
|
|
ngx_atomic_fetch_add(ngx_stat_writing, -1);
|
2004-09-16 00:00:43 +08:00
|
|
|
}
|
2005-10-22 03:12:18 +08:00
|
|
|
|
2004-09-16 00:00:43 +08:00
|
|
|
#endif
|
|
|
|
|
2003-12-22 17:40:48 +08:00
|
|
|
if (error && r->headers_out.status == 0) {
|
2003-05-14 00:02:32 +08:00
|
|
|
r->headers_out.status = error;
|
|
|
|
}
|
|
|
|
|
2008-06-30 23:32:57 +08:00
|
|
|
log->action = "logging request";
|
|
|
|
|
2005-10-24 23:09:41 +08:00
|
|
|
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
|
|
|
|
2005-11-26 18:11:11 +08:00
|
|
|
log_handler = cmcf->phases[NGX_HTTP_LOG_PHASE].handlers.elts;
|
|
|
|
n = cmcf->phases[NGX_HTTP_LOG_PHASE].handlers.nelts;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
|
|
log_handler[i](r);
|
2005-10-24 23:09:41 +08:00
|
|
|
}
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2008-06-30 23:32:57 +08:00
|
|
|
log->action = "closing request";
|
|
|
|
|
2004-06-07 03:49:18 +08:00
|
|
|
if (r->connection->timedout) {
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
if (clcf->reset_timedout_connection) {
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
linger.l_onoff = 1;
|
|
|
|
linger.l_linger = 0;
|
2004-06-07 03:49:18 +08:00
|
|
|
|
|
|
|
if (setsockopt(r->connection->fd, SOL_SOCKET, SO_LINGER,
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
(const void *) &linger, sizeof(struct linger)) == -1)
|
2004-06-07 03:49:18 +08:00
|
|
|
{
|
|
|
|
ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
|
|
|
|
"setsockopt(SO_LINGER) failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
/* the various request strings were allocated from r->pool */
|
2003-12-01 04:03:18 +08:00
|
|
|
ctx = log->data;
|
2004-11-11 22:07:14 +08:00
|
|
|
ctx->request = NULL;
|
2003-05-14 00:02:32 +08:00
|
|
|
|
2004-06-24 15:53:37 +08:00
|
|
|
r->request_line.len = 0;
|
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
r->connection->destroyed = 1;
|
|
|
|
|
2003-05-14 00:02:32 +08:00
|
|
|
ngx_destroy_pool(r->pool);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-07-25 17:41:38 +08:00
|
|
|
static void
|
2005-03-19 20:38:37 +08:00
|
|
|
ngx_http_close_connection(ngx_connection_t *c)
|
2003-05-12 23:52:24 +08:00
|
|
|
{
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
ngx_pool_t *pool;
|
|
|
|
|
2004-01-26 16:52:49 +08:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
2004-02-12 01:08:49 +08:00
|
|
|
"close http connection: %d", c->fd);
|
2003-05-12 23:52:24 +08:00
|
|
|
|
2005-09-07 00:09:32 +08:00
|
|
|
#if (NGX_HTTP_SSL)
|
2004-10-11 23:07:03 +08:00
|
|
|
|
|
|
|
if (c->ssl) {
|
|
|
|
if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
|
2005-11-15 21:30:52 +08:00
|
|
|
c->ssl->handler = ngx_http_close_connection;
|
2004-10-11 23:07:03 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2004-09-15 03:39:54 +08:00
|
|
|
#if (NGX_STAT_STUB)
|
2005-10-12 21:50:36 +08:00
|
|
|
ngx_atomic_fetch_add(ngx_stat_active, -1);
|
2004-09-15 03:39:54 +08:00
|
|
|
#endif
|
|
|
|
|
2005-12-05 21:18:09 +08:00
|
|
|
c->destroyed = 1;
|
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
pool = c->pool;
|
|
|
|
|
2004-09-07 23:29:22 +08:00
|
|
|
ngx_close_connection(c);
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
ngx_destroy_pool(pool);
|
2002-10-05 01:58:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len)
|
2002-08-26 23:18:19 +08:00
|
|
|
{
|
2005-01-25 20:27:35 +08:00
|
|
|
u_char *p;
|
2005-03-28 22:43:02 +08:00
|
|
|
ngx_http_request_t *r;
|
2005-01-25 20:27:35 +08:00
|
|
|
ngx_http_log_ctx_t *ctx;
|
2003-06-02 23:24:30 +08:00
|
|
|
|
2005-01-25 20:27:35 +08:00
|
|
|
if (log->action) {
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
p = ngx_snprintf(buf, len, " while %s", log->action);
|
2004-11-11 22:07:14 +08:00
|
|
|
len -= p - buf;
|
2005-03-28 22:43:02 +08:00
|
|
|
buf = p;
|
2003-03-21 00:09:44 +08:00
|
|
|
}
|
2004-11-11 22:07:14 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
ctx = log->data;
|
|
|
|
|
2007-12-30 16:01:50 +08:00
|
|
|
p = ngx_snprintf(buf, len, ", client: %V", &ctx->connection->addr_text);
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
len -= p - buf;
|
2005-03-28 22:43:02 +08:00
|
|
|
|
|
|
|
r = ctx->request;
|
2004-11-11 22:07:14 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
if (r) {
|
2006-07-11 21:20:19 +08:00
|
|
|
return r->log_handler(r, ctx->current_request, p, len);
|
2007-12-30 16:01:50 +08:00
|
|
|
|
|
|
|
} else {
|
|
|
|
p = ngx_snprintf(p, len, ", server: %V",
|
|
|
|
&ctx->connection->listening->addr_text);
|
2004-11-11 22:07:14 +08:00
|
|
|
}
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static u_char *
|
2006-07-11 21:20:19 +08:00
|
|
|
ngx_http_log_error_handler(ngx_http_request_t *r, ngx_http_request_t *sr,
|
|
|
|
u_char *buf, size_t len)
|
nginx-0.1.29-RELEASE import
*) 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; the bug had 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.
2005-05-12 22:58:06 +08:00
|
|
|
{
|
2007-12-30 16:15:27 +08:00
|
|
|
char *uri_separator;
|
|
|
|
u_char *p;
|
|
|
|
ngx_http_upstream_t *u;
|
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2004-11-11 22:07:14 +08:00
|
|
|
|
2007-12-30 16:15:27 +08:00
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
p = ngx_snprintf(buf, len, ", server: %V", &cscf->server_name);
|
|
|
|
len -= p - buf;
|
|
|
|
buf = p;
|
2005-03-23 00:02:46 +08:00
|
|
|
|
2007-11-27 20:22:01 +08:00
|
|
|
if (r->request_line.data == NULL && r->request_start) {
|
|
|
|
for (p = r->request_start; p < r->header_in->last; p++) {
|
|
|
|
if (*p == CR || *p == LF) {
|
|
|
|
break;
|
2005-03-28 22:43:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-27 20:22:01 +08:00
|
|
|
r->request_line.len = p - r->request_start;
|
|
|
|
r->request_line.data = r->request_start;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->request_line.len) {
|
|
|
|
p = ngx_snprintf(buf, len, ", request: \"%V\"", &r->request_line);
|
|
|
|
len -= p - buf;
|
|
|
|
buf = p;
|
2004-11-11 22:07:14 +08:00
|
|
|
}
|
|
|
|
|
2006-07-11 21:20:19 +08:00
|
|
|
if (r != sr) {
|
|
|
|
p = ngx_snprintf(buf, len, ", subrequest: \"%V\"", &sr->uri);
|
|
|
|
len -= p - buf;
|
|
|
|
buf = p;
|
|
|
|
}
|
|
|
|
|
|
|
|
u = sr->upstream;
|
|
|
|
|
2006-12-05 00:46:13 +08:00
|
|
|
if (u && u->peer.name) {
|
|
|
|
|
|
|
|
uri_separator = "";
|
|
|
|
|
|
|
|
#if (NGX_HAVE_UNIX_DOMAIN)
|
|
|
|
if (u->peer.sockaddr && u->peer.sockaddr->sa_family == AF_UNIX) {
|
|
|
|
uri_separator = ":";
|
|
|
|
}
|
|
|
|
#endif
|
2006-07-11 21:20:19 +08:00
|
|
|
|
|
|
|
p = ngx_snprintf(buf, len, ", upstream: \"%V%V%s%V\"",
|
2007-11-27 21:34:13 +08:00
|
|
|
&u->schema, u->peer.name,
|
2006-12-05 00:46:13 +08:00
|
|
|
uri_separator, &u->uri);
|
2006-07-11 21:20:19 +08:00
|
|
|
len -= p - buf;
|
|
|
|
buf = p;
|
|
|
|
}
|
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
if (r->headers_in.host) {
|
|
|
|
p = ngx_snprintf(buf, len, ", host: \"%V\"",
|
|
|
|
&r->headers_in.host->value);
|
|
|
|
len -= p - buf;
|
|
|
|
buf = p;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->headers_in.referer) {
|
|
|
|
p = ngx_snprintf(buf, len, ", referrer: \"%V\"",
|
|
|
|
&r->headers_in.referer->value);
|
|
|
|
buf = p;
|
|
|
|
}
|
2004-11-11 22:07:14 +08:00
|
|
|
|
2005-03-28 22:43:02 +08:00
|
|
|
return buf;
|
2002-08-07 00:39:45 +08:00
|
|
|
}
|