2003-01-09 02:36:00 -03:00
|
|
|
|
2004-09-28 04:34:51 -04:00
|
|
|
/*
|
2004-09-29 12:00:49 -04:00
|
|
|
* Copyright (C) Igor Sysoev
|
2004-09-28 04:34:51 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
2003-10-10 11:10:50 -04:00
|
|
|
#include <ngx_event.h>
|
2003-01-09 02:36:00 -03:00
|
|
|
#include <ngx_http.h>
|
2003-05-27 08:18:54 -04:00
|
|
|
#include <nginx.h>
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2004-11-11 11:07:14 -03:00
|
|
|
|
2006-04-07 10:08:04 -04:00
|
|
|
typedef struct {
|
2007-02-14 15:51:19 -03:00
|
|
|
u_char *name;
|
2006-04-07 10:08:04 -04:00
|
|
|
uint32_t method;
|
|
|
|
} ngx_http_method_name_t;
|
|
|
|
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
#define NGX_HTTP_LOCATION_EXACT 1
|
|
|
|
#define NGX_HTTP_LOCATION_AUTO_REDIRECT 2
|
2004-11-20 16:52:20 -03:00
|
|
|
#define NGX_HTTP_LOCATION_NOREGEX 3
|
|
|
|
#define NGX_HTTP_LOCATION_REGEX 4
|
2004-07-18 15:11:20 -04:00
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2007-01-24 06:14:08 -03:00
|
|
|
#define NGX_HTTP_REQUEST_BODY_FILE_OFF 0
|
|
|
|
#define NGX_HTTP_REQUEST_BODY_FILE_ON 1
|
2007-01-25 05:45:04 -03:00
|
|
|
#define NGX_HTTP_REQUEST_BODY_FILE_CLEAN 2
|
2007-01-24 06:14:08 -03:00
|
|
|
|
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r,
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_array_t *locations, size_t len);
|
2003-01-09 02:36:00 -03: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 10:58:06 -04:00
|
|
|
static ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf);
|
2003-07-20 17:15:59 -04:00
|
|
|
static void *ngx_http_core_create_main_conf(ngx_conf_t *cf);
|
|
|
|
static char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf);
|
|
|
|
static void *ngx_http_core_create_srv_conf(ngx_conf_t *cf);
|
|
|
|
static char *ngx_http_core_merge_srv_conf(ngx_conf_t *cf,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *parent, void *child);
|
2003-07-20 17:15:59 -04:00
|
|
|
static void *ngx_http_core_create_loc_conf(ngx_conf_t *cf);
|
|
|
|
static char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *parent, void *child);
|
2003-03-20 12:09:44 -04:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *dummy);
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *dummy);
|
2005-03-22 12:02:46 -04:00
|
|
|
static int ngx_libc_cdecl ngx_http_core_cmp_locations(const void *first,
|
|
|
|
const void *second);
|
2005-02-03 16:33:37 -03:00
|
|
|
|
|
|
|
static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *conf);
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *conf);
|
2005-02-03 16:33:37 -03:00
|
|
|
|
|
|
|
static char *ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *conf);
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *conf);
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
|
2006-04-07 10:08:04 -04:00
|
|
|
static char *ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd,
|
|
|
|
void *conf);
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *conf);
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *conf);
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-02-09 11:31:07 -03:00
|
|
|
void *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 10:58:06 -04:00
|
|
|
static char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd,
|
|
|
|
void *conf);
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data);
|
2007-05-07 05:20:42 -04:00
|
|
|
static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data);
|
2003-10-29 05:30:44 -03:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
static ngx_conf_post_t ngx_http_core_lowat_post =
|
2007-05-07 04:49:15 -04:00
|
|
|
{ ngx_http_core_lowat_check };
|
2003-10-29 05:30:44 -03:00
|
|
|
|
2007-05-07 05:20:42 -04:00
|
|
|
static ngx_conf_post_handler_pt ngx_http_core_pool_size_p =
|
|
|
|
ngx_http_core_pool_size;
|
|
|
|
|
2006-02-03 09:58:48 -03:00
|
|
|
static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_host_names = {
|
|
|
|
ngx_conf_deprecated, "optimize_host_names", "optimize_server_names"
|
|
|
|
};
|
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2007-01-24 06:14:08 -03:00
|
|
|
static ngx_conf_enum_t ngx_http_core_request_body_in_file[] = {
|
|
|
|
{ ngx_string("off"), NGX_HTTP_REQUEST_BODY_FILE_OFF },
|
|
|
|
{ ngx_string("on"), NGX_HTTP_REQUEST_BODY_FILE_ON },
|
2007-01-25 05:45:04 -03:00
|
|
|
{ ngx_string("clean"), NGX_HTTP_REQUEST_BODY_FILE_CLEAN },
|
2007-01-24 06:14:08 -03:00
|
|
|
{ ngx_null_string, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
static ngx_command_t ngx_http_core_commands[] = {
|
|
|
|
|
2006-02-08 12:33:12 -03:00
|
|
|
{ ngx_string("variables_hash_max_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_main_conf_t, variables_hash_max_size),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("variables_hash_bucket_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_main_conf_t, variables_hash_bucket_size),
|
|
|
|
NULL },
|
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
{ ngx_string("server_names_hash_max_size"),
|
2004-12-21 09:30:30 -03:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
2005-12-26 14:07:48 -03:00
|
|
|
offsetof(ngx_http_core_main_conf_t, server_names_hash_max_size),
|
2004-12-21 09:30:30 -03:00
|
|
|
NULL },
|
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
{ ngx_string("server_names_hash_bucket_size"),
|
2004-12-21 09:30:30 -03:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
2005-12-26 14:07:48 -03:00
|
|
|
offsetof(ngx_http_core_main_conf_t, server_names_hash_bucket_size),
|
2004-12-21 09:30:30 -03:00
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("server"),
|
2006-05-23 10:54:58 -04:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_MULTI|NGX_CONF_NOARGS,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_server,
|
2003-11-30 17:03:18 -03:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("connection_pool_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_srv_conf_t, connection_pool_size),
|
2007-05-07 05:20:42 -04:00
|
|
|
&ngx_http_core_pool_size_p },
|
2003-11-30 17:03:18 -03:00
|
|
|
|
|
|
|
{ ngx_string("request_pool_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_srv_conf_t, request_pool_size),
|
2007-05-07 05:20:42 -04:00
|
|
|
&ngx_http_core_pool_size_p },
|
2003-11-30 17:03:18 -03:00
|
|
|
|
|
|
|
{ ngx_string("client_header_timeout"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_msec_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_srv_conf_t, client_header_timeout),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("client_header_buffer_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_srv_conf_t, client_header_buffer_size),
|
|
|
|
NULL },
|
|
|
|
|
2004-09-23 02:32:00 -04:00
|
|
|
{ ngx_string("large_client_header_buffers"),
|
2004-09-22 12:18:21 -04:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE2,
|
|
|
|
ngx_conf_set_bufs_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
2004-09-23 02:32:00 -04:00
|
|
|
offsetof(ngx_http_core_srv_conf_t, large_client_header_buffers),
|
2003-11-30 17:03:18 -03:00
|
|
|
NULL },
|
|
|
|
|
2006-02-03 09:58:48 -03:00
|
|
|
{ ngx_string("optimize_server_names"),
|
2006-01-24 13:08:27 -03:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
2006-02-03 09:58:48 -03:00
|
|
|
offsetof(ngx_http_core_srv_conf_t, optimize_server_names),
|
2006-01-24 13:08:27 -03:00
|
|
|
NULL },
|
|
|
|
|
2006-02-03 09:58:48 -03:00
|
|
|
{ ngx_string("optimize_host_names"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_srv_conf_t, optimize_server_names),
|
|
|
|
&ngx_conf_deprecated_optimize_host_names },
|
|
|
|
|
2005-05-14 14:42:03 -04:00
|
|
|
{ ngx_string("ignore_invalid_headers"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_srv_conf_t, ignore_invalid_headers),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("location"),
|
2004-07-18 15:11:20 -04:00
|
|
|
NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_location,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("listen"),
|
2005-06-15 14:33:41 -04:00
|
|
|
NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_listen,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("server_name"),
|
|
|
|
NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_server_name,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
{ ngx_string("types_hash_max_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, types_hash_max_size),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("types_hash_bucket_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, types_hash_bucket_size),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("types"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
|
|
|
|
|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_types,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("default_type"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_str_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, default_type),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("root"),
|
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 10:58:06 -04:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|
|
|
|
|NGX_CONF_TAKE1,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_root,
|
2004-03-16 03:10:12 -04:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("alias"),
|
|
|
|
NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_root,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
2004-03-16 03:10:12 -04:00
|
|
|
0,
|
2003-11-30 17:03:18 -03:00
|
|
|
NULL },
|
|
|
|
|
2006-04-07 10:08:04 -04:00
|
|
|
{ ngx_string("limit_except"),
|
|
|
|
NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_1MORE,
|
|
|
|
ngx_http_core_limit_except,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
2004-03-19 01:25:53 -04:00
|
|
|
{ ngx_string("client_max_body_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
2006-07-07 12:33:19 -04:00
|
|
|
ngx_conf_set_off_slot,
|
2004-03-19 01:25:53 -04:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, client_max_body_size),
|
|
|
|
NULL },
|
|
|
|
|
2004-04-01 12:20:53 -04:00
|
|
|
{ ngx_string("client_body_buffer_size"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, client_body_buffer_size),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("client_body_timeout"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_msec_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, client_body_timeout),
|
|
|
|
NULL },
|
|
|
|
|
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 10:03:58 -03:00
|
|
|
{ ngx_string("client_body_temp_path"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
|
|
|
|
ngx_conf_set_path_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, client_body_temp_path),
|
|
|
|
(void *) ngx_garbage_collector_temp_handler },
|
|
|
|
|
2006-04-14 05:53:38 -04:00
|
|
|
{ ngx_string("client_body_in_file_only"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
2007-01-24 06:14:08 -03:00
|
|
|
ngx_conf_set_enum_slot,
|
2006-04-14 05:53:38 -04:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only),
|
2007-01-24 06:14:08 -03:00
|
|
|
&ngx_http_core_request_body_in_file },
|
2006-04-14 05:53:38 -04:00
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("sendfile"),
|
2007-01-21 14:42:28 -03:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|
|
|
|
|NGX_CONF_TAKE1,
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, sendfile),
|
|
|
|
NULL },
|
|
|
|
|
2007-05-07 02:33:39 -04:00
|
|
|
{ ngx_string("sendfile_max_chunk"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk),
|
|
|
|
NULL },
|
|
|
|
|
2004-01-05 17:55:48 -03:00
|
|
|
{ ngx_string("tcp_nopush"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, tcp_nopush),
|
|
|
|
NULL },
|
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
{ ngx_string("tcp_nodelay"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, tcp_nodelay),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("send_timeout"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_msec_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, send_timeout),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("send_lowat"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, send_lowat),
|
2005-02-03 16:33:37 -03:00
|
|
|
&ngx_http_core_lowat_post },
|
2003-11-30 17:03:18 -03:00
|
|
|
|
2004-07-14 12:01:42 -04:00
|
|
|
{ ngx_string("postpone_output"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, postpone_output),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("limit_rate"),
|
2005-02-03 16:33:37 -03:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|
|
|
|
|NGX_CONF_TAKE1,
|
2004-07-14 12:01:42 -04:00
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, limit_rate),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("keepalive_timeout"),
|
2004-09-17 12:07:35 -04:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_keepalive,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
2004-09-17 12:07:35 -04:00
|
|
|
0,
|
2003-11-30 17:03:18 -03:00
|
|
|
NULL },
|
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
{ ngx_string("satisfy_any"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, satisfy_any),
|
|
|
|
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 10:58:06 -04:00
|
|
|
{ ngx_string("internal"),
|
|
|
|
NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS,
|
|
|
|
ngx_http_core_internal,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("lingering_time"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_msec_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, lingering_time),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("lingering_timeout"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_msec_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, lingering_timeout),
|
|
|
|
NULL },
|
|
|
|
|
2004-06-06 15:49:18 -04:00
|
|
|
{ ngx_string("reset_timedout_connection"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, reset_timedout_connection),
|
|
|
|
NULL },
|
|
|
|
|
2005-06-07 11:56:31 -04:00
|
|
|
{ ngx_string("port_in_redirect"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, port_in_redirect),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("msie_padding"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, msie_padding),
|
|
|
|
NULL },
|
|
|
|
|
2006-08-28 12:57:48 -04:00
|
|
|
{ ngx_string("msie_refresh"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, msie_refresh),
|
|
|
|
NULL },
|
|
|
|
|
2005-07-08 10:34:20 -04:00
|
|
|
{ ngx_string("log_not_found"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, log_not_found),
|
|
|
|
NULL },
|
|
|
|
|
2006-08-28 12:57:48 -04:00
|
|
|
{ ngx_string("recursive_error_pages"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
|
|
|
|
ngx_conf_set_flag_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, recursive_error_pages),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("error_page"),
|
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 10:58:06 -04:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|
|
|
|
|NGX_CONF_2MORE,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_error_page,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
{ ngx_string("post_action"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|
|
|
|
|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_str_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, post_action),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("error_log"),
|
2004-01-20 17:40:08 -03:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_error_log,
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
2004-03-12 13:57:08 -03:00
|
|
|
#if (NGX_HTTP_CACHE)
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("open_file_cache"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE4,
|
|
|
|
ngx_http_set_cache_slot,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_loc_conf_t, open_files),
|
|
|
|
NULL },
|
|
|
|
|
2004-03-12 13:57:08 -03:00
|
|
|
#endif
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_null_command
|
2003-01-09 02:36:00 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-07-28 11:16:17 -04:00
|
|
|
static ngx_http_module_t ngx_http_core_module_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 10:58:06 -04:00
|
|
|
ngx_http_core_preconfiguration, /* preconfiguration */
|
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-09 14:25:55 -03:00
|
|
|
NULL, /* postconfiguration */
|
2003-11-10 14:17:31 -03:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
ngx_http_core_create_main_conf, /* create main configuration */
|
|
|
|
ngx_http_core_init_main_conf, /* init main configuration */
|
|
|
|
|
|
|
|
ngx_http_core_create_srv_conf, /* create server configuration */
|
|
|
|
ngx_http_core_merge_srv_conf, /* merge server configuration */
|
2003-03-20 12:09:44 -04:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
ngx_http_core_create_loc_conf, /* create location configuration */
|
|
|
|
ngx_http_core_merge_loc_conf /* merge location configuration */
|
2003-01-09 02:36:00 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ngx_module_t ngx_http_core_module = {
|
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 10:58:06 -04:00
|
|
|
NGX_MODULE_V1,
|
2003-01-09 02:36:00 -03:00
|
|
|
&ngx_http_core_module_ctx, /* module context */
|
|
|
|
ngx_http_core_commands, /* module directives */
|
2003-05-27 08:18:54 -04:00
|
|
|
NGX_HTTP_MODULE, /* module type */
|
2005-09-08 10:36:09 -04:00
|
|
|
NULL, /* init master */
|
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 10:58:06 -04:00
|
|
|
NULL, /* init module */
|
2005-09-08 10:36:09 -04:00
|
|
|
NULL, /* init process */
|
|
|
|
NULL, /* init thread */
|
|
|
|
NULL, /* exit thread */
|
|
|
|
NULL, /* exit process */
|
|
|
|
NULL, /* exit master */
|
|
|
|
NGX_MODULE_V1_PADDING
|
2003-01-09 02:36:00 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
void
|
|
|
|
ngx_http_handler(ngx_http_request_t *r)
|
2003-05-15 11:42:53 -04:00
|
|
|
{
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
|
|
|
|
2005-01-25 09:27:35 -03:00
|
|
|
r->connection->log->action = NULL;
|
2003-05-15 11:42:53 -04:00
|
|
|
|
|
|
|
r->connection->unexpected_eof = 0;
|
|
|
|
|
2006-08-16 09:09:33 -04:00
|
|
|
if (!r->internal) {
|
2005-09-23 07:02:22 -04:00
|
|
|
switch (r->headers_in.connection_type) {
|
|
|
|
case 0:
|
|
|
|
if (r->http_version > NGX_HTTP_VERSION_10) {
|
|
|
|
r->keepalive = 1;
|
|
|
|
} else {
|
|
|
|
r->keepalive = 0;
|
|
|
|
}
|
|
|
|
break;
|
2003-10-21 13:49:56 -03:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
case NGX_HTTP_CONNECTION_CLOSE:
|
|
|
|
r->keepalive = 0;
|
|
|
|
break;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
case NGX_HTTP_CONNECTION_KEEP_ALIVE:
|
|
|
|
r->keepalive = 1;
|
|
|
|
break;
|
|
|
|
}
|
2004-07-30 13:05:14 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
if (r->keepalive && r->headers_in.msie && r->method == NGX_HTTP_POST) {
|
2004-07-30 13:05:14 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
/*
|
2006-08-30 06:39:17 -04:00
|
|
|
* MSIE may wait for some time if an response for
|
|
|
|
* a POST request was sent over a keepalive connection
|
2005-09-23 07:02:22 -04:00
|
|
|
*/
|
2004-07-30 13:05:14 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
r->keepalive = 0;
|
|
|
|
}
|
2003-05-15 11:42:53 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
if (r->headers_in.content_length_n > 0) {
|
|
|
|
r->lingering_close = 1;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
} else {
|
|
|
|
r->lingering_close = 0;
|
|
|
|
}
|
2005-03-28 10:43:02 -04:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
r->phase_handler = 0;
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
} else {
|
|
|
|
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
|
|
|
r->phase_handler = cmcf->phase_engine.server_rewrite_index;
|
|
|
|
}
|
|
|
|
|
2006-09-25 13:49:49 -04:00
|
|
|
if (r->unparsed_uri.len) {
|
|
|
|
r->valid_unparsed_uri = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->valid_location = 1;
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
r->write_event_handler = ngx_http_core_run_phases;
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_run_phases(r);
|
2003-10-10 11:10:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
void
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_http_core_run_phases(ngx_http_request_t *r)
|
2003-10-10 11:10:50 -04:00
|
|
|
{
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_int_t rc;
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_phase_handler_t *ph;
|
2003-10-10 11:10:50 -04:00
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
|
|
|
|
|
|
|
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
ph = cmcf->phase_engine.handlers;
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
while (ph[r->phase_handler].checker) {
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
rc = ph[r->phase_handler].checker(r, &ph[r->phase_handler]);
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
if (rc == NGX_OK) {
|
2003-11-30 17:03:18 -03:00
|
|
|
return;
|
|
|
|
}
|
2006-08-30 06:39:17 -04:00
|
|
|
}
|
|
|
|
}
|
2003-11-30 17:03:18 -03:00
|
|
|
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_core_generic_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph)
|
|
|
|
{
|
|
|
|
ngx_int_t rc;
|
2005-09-23 07:02:22 -04:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
/*
|
|
|
|
* generic phase checker,
|
|
|
|
* used by the post read, server rewrite, rewrite, and pre-access phases
|
|
|
|
*/
|
2005-09-23 07:02:22 -04:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"generic phase: %ui", r->phase_handler);
|
2006-07-07 12:33:19 -04:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
rc = ph->handler(r);
|
2006-07-07 12:33:19 -04:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
if (rc == NGX_OK) {
|
|
|
|
r->phase_handler = ph->next;
|
|
|
|
return NGX_AGAIN;
|
2003-11-30 17:03:18 -03:00
|
|
|
}
|
2003-10-10 11:10:50 -04:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
if (rc == NGX_DECLINED) {
|
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
2003-11-30 17:03:18 -03:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
if (rc == NGX_AGAIN || rc == NGX_DONE) {
|
|
|
|
return NGX_OK;
|
2003-10-10 11:10:50 -04:00
|
|
|
}
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
/* rc == NGX_ERROR || rc == NGX_HTTP_... */
|
2003-11-30 17:03:18 -03:00
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_finalize_request(r, rc);
|
|
|
|
|
|
|
|
return NGX_OK;
|
2003-10-10 11:10:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_core_find_config_phase(ngx_http_request_t *r,
|
|
|
|
ngx_http_phase_handler_t *ph)
|
2003-10-10 11:10:50 -04:00
|
|
|
{
|
2004-07-18 15:11:20 -04:00
|
|
|
ngx_int_t rc;
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2005-02-16 10:40:36 -03:00
|
|
|
r->content_handler = NULL;
|
|
|
|
r->uri_changed = 0;
|
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
rc = ngx_http_core_find_location(r, &cscf->locations, 0);
|
2004-07-18 15:11:20 -04:00
|
|
|
|
|
|
|
if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return NGX_OK;
|
2004-07-18 15:11:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
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 10:58:06 -04:00
|
|
|
if (!r->internal && clcf->internal) {
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
|
|
|
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
2005-10-05 10:46:21 -04:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"using configuration \"%s%V\"",
|
|
|
|
(clcf->noname ? "*" : (clcf->exact_match ? "=" : "")),
|
|
|
|
&clcf->name);
|
|
|
|
|
2005-08-23 11:36:54 -04:00
|
|
|
ngx_http_update_location_config(r);
|
2004-07-18 15:11:20 -04:00
|
|
|
|
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2006-07-07 12:33:19 -04:00
|
|
|
"http cl:%O max:%O",
|
2004-11-11 11:07:14 -03:00
|
|
|
r->headers_in.content_length_n, clcf->client_max_body_size);
|
2004-07-18 15:11:20 -04:00
|
|
|
|
|
|
|
if (r->headers_in.content_length_n != -1
|
2006-08-14 11:09:38 -04:00
|
|
|
&& !r->discard_body
|
2004-07-18 15:11:20 -04:00
|
|
|
&& clcf->client_max_body_size
|
2006-07-07 12:33:19 -04:00
|
|
|
&& clcf->client_max_body_size < r->headers_in.content_length_n)
|
2004-07-18 15:11:20 -04:00
|
|
|
{
|
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
2006-07-07 12:33:19 -04:00
|
|
|
"client intented to send too large body: %O bytes",
|
2004-07-18 15:11:20 -04:00
|
|
|
r->headers_in.content_length_n);
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE);
|
|
|
|
return NGX_OK;
|
2004-07-18 15:11:20 -04:00
|
|
|
}
|
2003-11-25 17:44:56 -03:00
|
|
|
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (rc == NGX_HTTP_LOCATION_AUTO_REDIRECT) {
|
2004-09-06 14:45:00 -04:00
|
|
|
r->headers_out.location = ngx_list_push(&r->headers_out.headers);
|
|
|
|
if (r->headers_out.location == NULL) {
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return NGX_OK;
|
2004-07-18 15:11:20 -04: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 10:58:06 -04:00
|
|
|
/*
|
|
|
|
* we do not need to set the r->headers_out.location->hash and
|
|
|
|
* r->headers_out.location->key fields
|
|
|
|
*/
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
r->headers_out.location->value = clcf->name;
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_MOVED_PERMANENTLY);
|
|
|
|
return NGX_OK;
|
2004-07-18 15:11:20 -04:00
|
|
|
}
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngx_int_t
|
|
|
|
ngx_http_core_post_rewrite_phase(ngx_http_request_t *r,
|
|
|
|
ngx_http_phase_handler_t *ph)
|
|
|
|
{
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"post rewrite phase: %ui", r->phase_handler);
|
|
|
|
|
|
|
|
if (!r->uri_changed) {
|
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"uri changes: %d", r->uri_changes);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* gcc before 3.3 compiles the broken code for
|
|
|
|
* if (r->uri_changes-- == 0)
|
|
|
|
* if the r->uri_changes is defined as
|
|
|
|
* unsigned uri_changes:4
|
|
|
|
*/
|
|
|
|
|
|
|
|
r->uri_changes--;
|
|
|
|
|
|
|
|
if (r->uri_changes == 0) {
|
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
|
|
|
"rewrite or internal redirection cycle "
|
|
|
|
"while processing \"%V\"", &r->uri);
|
|
|
|
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->phase_handler = ph->next;
|
|
|
|
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngx_int_t
|
|
|
|
ngx_http_core_access_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph)
|
|
|
|
{
|
|
|
|
ngx_int_t rc;
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
|
|
|
|
if (r != r->main) {
|
|
|
|
r->phase_handler = ph->next;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"access phase: %ui", r->phase_handler);
|
|
|
|
|
|
|
|
rc = ph->handler(r);
|
|
|
|
|
|
|
|
if (rc == NGX_DECLINED) {
|
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rc == NGX_AGAIN || rc == NGX_DONE) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
if (clcf->satisfy_any == 0) {
|
|
|
|
|
|
|
|
if (rc == NGX_OK) {
|
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if (rc == NGX_OK) {
|
|
|
|
r->access_code = 0;
|
|
|
|
|
|
|
|
if (r->headers_out.www_authenticate) {
|
|
|
|
r->headers_out.www_authenticate->hash = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->phase_handler = ph->next;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rc == NGX_HTTP_FORBIDDEN || rc == NGX_HTTP_UNAUTHORIZED) {
|
|
|
|
r->access_code = rc;
|
|
|
|
|
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* rc == NGX_ERROR || rc == NGX_HTTP_... */
|
|
|
|
|
|
|
|
ngx_http_finalize_request(r, rc);
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngx_int_t
|
|
|
|
ngx_http_core_post_access_phase(ngx_http_request_t *r,
|
|
|
|
ngx_http_phase_handler_t *ph)
|
|
|
|
{
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"post access phase: %ui", r->phase_handler);
|
|
|
|
|
|
|
|
if (r->access_code) {
|
|
|
|
|
|
|
|
if (r->access_code == NGX_HTTP_FORBIDDEN) {
|
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
|
|
|
"access forbidden by rule");
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_http_finalize_request(r, r->access_code);
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngx_int_t
|
|
|
|
ngx_http_core_content_phase(ngx_http_request_t *r,
|
|
|
|
ngx_http_phase_handler_t *ph)
|
|
|
|
{
|
2006-10-12 09:36:54 -04:00
|
|
|
size_t root;
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_int_t rc;
|
|
|
|
ngx_str_t path;
|
|
|
|
|
|
|
|
if (r->content_handler) {
|
|
|
|
r->write_event_handler = ngx_http_request_empty_handler;
|
|
|
|
ngx_http_finalize_request(r, r->content_handler(r));
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"content phase: %ui", r->phase_handler);
|
|
|
|
|
|
|
|
rc = ph->handler(r);
|
|
|
|
|
|
|
|
if (rc == NGX_DONE) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rc != NGX_DECLINED) {
|
|
|
|
ngx_http_finalize_request(r, rc);
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* rc == NGX_DECLINED */
|
|
|
|
|
|
|
|
ph++;
|
|
|
|
|
|
|
|
if (ph->checker) {
|
|
|
|
r->phase_handler++;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* no content handler was found */
|
|
|
|
|
|
|
|
if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) {
|
|
|
|
|
2006-10-12 09:36:54 -04:00
|
|
|
if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) {
|
2006-08-30 06:39:17 -04:00
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
|
|
|
"directory index of \"%V\" is forbidden", &path);
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_FORBIDDEN);
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no handler found");
|
|
|
|
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
|
2005-08-23 11:36:54 -04:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
ngx_http_update_location_config(ngx_http_request_t *r)
|
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
2006-04-07 10:08:04 -04:00
|
|
|
if (r->method & clcf->limit_except) {
|
|
|
|
r->loc_conf = clcf->limit_except_loc_conf;
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
}
|
|
|
|
|
2006-04-26 11:21:08 -04:00
|
|
|
if (r == r->main) {
|
2007-03-28 10:38:33 -04:00
|
|
|
r->connection->log->file = clcf->err_log->file;
|
|
|
|
|
2006-04-26 11:21:08 -04:00
|
|
|
if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
|
|
|
|
r->connection->log->log_level = clcf->err_log->log_level;
|
|
|
|
}
|
2005-08-23 11:36:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) {
|
|
|
|
r->connection->sendfile = 1;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
r->connection->sendfile = 0;
|
|
|
|
}
|
|
|
|
|
2006-04-14 05:53:38 -04:00
|
|
|
if (clcf->client_body_in_file_only) {
|
|
|
|
r->request_body_in_file_only = 1;
|
|
|
|
r->request_body_in_persistent_file = 1;
|
2007-01-25 05:45:04 -03:00
|
|
|
r->request_body_in_clean_file =
|
|
|
|
clcf->client_body_in_file_only == NGX_HTTP_REQUEST_BODY_FILE_CLEAN;
|
2006-04-19 11:30:56 -04:00
|
|
|
r->request_body_file_log_level = NGX_LOG_NOTICE;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
r->request_body_file_log_level = NGX_LOG_WARN;
|
2006-04-14 05:53:38 -04:00
|
|
|
}
|
|
|
|
|
2005-08-23 11:36:54 -04:00
|
|
|
if (r->keepalive && clcf->keepalive_timeout == 0) {
|
|
|
|
r->keepalive = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!clcf->tcp_nopush) {
|
|
|
|
/* disable TCP_NOPUSH/TCP_CORK use */
|
|
|
|
r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
|
|
|
|
}
|
|
|
|
|
2006-02-16 12:26:46 -03:00
|
|
|
if (r->limit_rate == 0) {
|
|
|
|
r->limit_rate = clcf->limit_rate;
|
|
|
|
}
|
2005-07-08 10:34:20 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (clcf->handler) {
|
|
|
|
r->content_handler = clcf->handler;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_core_find_location(ngx_http_request_t *r,
|
|
|
|
ngx_array_t *locations, size_t len)
|
2004-07-18 15:11:20 -04:00
|
|
|
{
|
|
|
|
ngx_int_t n, rc;
|
2004-11-20 16:52:20 -03:00
|
|
|
ngx_uint_t i, found, noregex;
|
2004-07-18 15:11:20 -04:00
|
|
|
ngx_http_core_loc_conf_t *clcf, **clcfp;
|
|
|
|
|
2005-10-05 10:46:21 -04:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"find location for \"%V\"", &r->uri);
|
2004-07-18 15:11:20 -04:00
|
|
|
|
|
|
|
found = 0;
|
2004-11-20 16:52:20 -03:00
|
|
|
noregex = 0;
|
2004-07-18 15:11:20 -04:00
|
|
|
|
|
|
|
clcfp = locations->elts;
|
|
|
|
for (i = 0; i < locations->nelts; i++) {
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
#if (NGX_PCRE)
|
2003-11-25 17:44:56 -03:00
|
|
|
if (clcfp[i]->regex) {
|
|
|
|
break;
|
|
|
|
}
|
2003-12-14 17:10:27 -03:00
|
|
|
#endif
|
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
if (clcfp[i]->noname) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-12-14 17:10:27 -03:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"find location: %s\"%V\"",
|
|
|
|
clcfp[i]->exact_match ? "= " : "", &clcfp[i]->name);
|
2003-11-25 17:44:56 -03:00
|
|
|
|
2003-11-18 18:34:08 -03:00
|
|
|
if (clcfp[i]->auto_redirect
|
|
|
|
&& r->uri.len == clcfp[i]->name.len - 1
|
|
|
|
&& ngx_strncmp(r->uri.data, clcfp[i]->name.data,
|
2007-01-12 18:57:20 -03:00
|
|
|
clcfp[i]->name.len - 1)
|
|
|
|
== 0)
|
2003-11-18 18:34:08 -03:00
|
|
|
{
|
2004-07-18 15:11:20 -04:00
|
|
|
/* the locations are lexicographically sorted */
|
|
|
|
|
|
|
|
r->loc_conf = clcfp[i]->loc_conf;
|
|
|
|
|
|
|
|
return NGX_HTTP_LOCATION_AUTO_REDIRECT;
|
2003-11-18 18:34:08 -03:00
|
|
|
}
|
|
|
|
|
2003-07-20 17:15:59 -04:00
|
|
|
if (r->uri.len < clcfp[i]->name.len) {
|
|
|
|
continue;
|
|
|
|
}
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
n = ngx_strncmp(r->uri.data, clcfp[i]->name.data, clcfp[i]->name.len);
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (n < 0) {
|
|
|
|
/* the locations are lexicographically sorted */
|
2003-07-20 17:15:59 -04:00
|
|
|
break;
|
|
|
|
}
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (n == 0) {
|
2005-02-03 16:33:37 -03:00
|
|
|
if (clcfp[i]->exact_match) {
|
|
|
|
|
|
|
|
if (r->uri.len == clcfp[i]->name.len) {
|
|
|
|
r->loc_conf = clcfp[i]->loc_conf;
|
|
|
|
return NGX_HTTP_LOCATION_EXACT;
|
|
|
|
}
|
|
|
|
|
|
|
|
continue;
|
2004-07-26 12:21:18 -04:00
|
|
|
}
|
|
|
|
|
2004-08-30 15:24:51 -04:00
|
|
|
if (len > clcfp[i]->name.len) {
|
2004-07-18 15:11:20 -04:00
|
|
|
/* the previous match is longer */
|
2003-11-25 17:44:56 -03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
r->loc_conf = clcfp[i]->loc_conf;
|
2004-11-20 16:52:20 -03:00
|
|
|
noregex = clcfp[i]->noregex;
|
2004-07-18 15:11:20 -04:00
|
|
|
found = 1;
|
|
|
|
}
|
|
|
|
}
|
2003-11-25 17:44:56 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (found) {
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
2003-11-25 17:44:56 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (clcf->locations.nelts) {
|
2005-02-03 16:33:37 -03:00
|
|
|
rc = ngx_http_core_find_location(r, &clcf->locations, len);
|
2003-11-25 17:44:56 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (rc != NGX_OK) {
|
|
|
|
return rc;
|
2004-04-08 11:58:25 -04:00
|
|
|
}
|
2003-07-20 17:15:59 -04:00
|
|
|
}
|
2003-04-08 11:40:10 -04:00
|
|
|
}
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
#if (NGX_PCRE)
|
2003-10-21 13:49:56 -03:00
|
|
|
|
2004-11-20 16:52:20 -03:00
|
|
|
if (noregex) {
|
|
|
|
return NGX_HTTP_LOCATION_NOREGEX;
|
|
|
|
}
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
/* regex matches */
|
2004-01-05 17:55:48 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
for (/* void */; i < locations->nelts; i++) {
|
2004-03-23 02:01:52 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (!clcfp[i]->regex) {
|
|
|
|
continue;
|
|
|
|
}
|
2004-03-23 02:01:52 -04:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
if (clcfp[i]->noname) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"find location: ~ \"%V\"", &clcfp[i]->name);
|
2004-03-23 02:01:52 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
n = ngx_regex_exec(clcfp[i]->regex, &r->uri, NULL, 0);
|
2004-03-23 02:01:52 -04:00
|
|
|
|
2005-01-19 10:10:56 -03:00
|
|
|
if (n == NGX_REGEX_NO_MATCHED) {
|
2004-07-18 15:11:20 -04:00
|
|
|
continue;
|
|
|
|
}
|
2004-03-23 02:01:52 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (n < 0) {
|
|
|
|
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
|
|
|
|
ngx_regex_exec_n
|
2004-11-11 11:07:14 -03:00
|
|
|
" failed: %d on \"%V\" using \"%V\"",
|
|
|
|
n, &r->uri, &clcfp[i]->name);
|
2003-11-18 18:34:08 -03:00
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
/* match */
|
2003-11-18 18:34:08 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
r->loc_conf = clcfp[i]->loc_conf;
|
2003-11-18 18:34:08 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
return NGX_HTTP_LOCATION_REGEX;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
#endif /* NGX_PCRE */
|
2004-07-18 15:11:20 -04:00
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_set_content_type(ngx_http_request_t *r)
|
2003-11-30 17:03:18 -03:00
|
|
|
{
|
2005-02-03 16:33:37 -03:00
|
|
|
u_char c, *p, *exten;
|
2005-12-16 12:07:08 -03:00
|
|
|
ngx_str_t *type;
|
2006-05-11 10:43:47 -04:00
|
|
|
ngx_uint_t i, hash;
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
|
2006-08-14 11:09:38 -04:00
|
|
|
if (r->headers_out.content_type.len) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
if (r->exten.len) {
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2006-05-11 10:43:47 -04:00
|
|
|
hash = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < r->exten.len; i++) {
|
|
|
|
c = r->exten.data[i];
|
|
|
|
|
|
|
|
if (c >= 'A' && c <= 'Z') {
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
p = ngx_palloc(r->pool, r->exten.len);
|
|
|
|
if (p == NULL) {
|
2005-02-03 16:33:37 -03:00
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-05-11 10:43:47 -04:00
|
|
|
hash = 0;
|
2005-02-03 16:33:37 -03:00
|
|
|
exten = p;
|
|
|
|
|
|
|
|
for (i = 0; i < r->exten.len; i++) {
|
2006-05-11 10:43:47 -04:00
|
|
|
c = ngx_tolower(r->exten.data[i]);
|
|
|
|
hash = ngx_hash(hash, c);
|
|
|
|
*p++ = c;
|
2005-02-03 16:33:37 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
r->exten.data = exten;
|
2006-05-11 10:43:47 -04:00
|
|
|
|
|
|
|
break;
|
2005-02-03 16:33:37 -03:00
|
|
|
}
|
|
|
|
|
2006-05-11 10:43:47 -04:00
|
|
|
hash = ngx_hash(hash, c);
|
2005-02-03 16:33:37 -03:00
|
|
|
}
|
|
|
|
|
2006-05-11 10:43:47 -04:00
|
|
|
type = ngx_hash_find(&clcf->types_hash, hash,
|
2005-12-16 12:07:08 -03:00
|
|
|
r->exten.data, r->exten.len);
|
2003-11-30 17:03:18 -03:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
if (type) {
|
2006-06-28 12:00:26 -04:00
|
|
|
r->headers_out.content_type_len = type->len;
|
2005-12-16 12:07:08 -03:00
|
|
|
r->headers_out.content_type = *type;
|
2006-06-28 12:00:26 -04:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
return NGX_OK;
|
2003-11-30 17:03:18 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-06-28 12:00:26 -04:00
|
|
|
r->headers_out.content_type_len = clcf->default_type.len;
|
2005-12-16 12:07:08 -03:00
|
|
|
r->headers_out.content_type = clcf->default_type;
|
2003-11-30 17:03:18 -03:00
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-07 09:30:52 -04:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_set_exten(ngx_http_request_t *r)
|
|
|
|
{
|
|
|
|
ngx_int_t i;
|
|
|
|
|
|
|
|
r->exten.len = 0;
|
|
|
|
r->exten.data = NULL;
|
|
|
|
|
|
|
|
for (i = r->uri.len - 1; i > 1; i--) {
|
|
|
|
if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
|
|
|
|
|
2006-05-11 10:43:47 -04:00
|
|
|
r->exten.len = r->uri.len - i - 1;
|
|
|
|
r->exten.data = &r->uri.data[i + 1];
|
2005-10-07 09:30:52 -04:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
} else if (r->uri.data[i] == '/') {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_send_header(ngx_http_request_t *r)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
2005-10-05 10:46:21 -04:00
|
|
|
if (r->err_status) {
|
2003-11-10 18:09:22 -03:00
|
|
|
r->headers_out.status = r->err_status;
|
|
|
|
r->headers_out.status_line.len = 0;
|
|
|
|
}
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
return ngx_http_top_header_filter(r);
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in)
|
2004-05-12 01:37:55 -04:00
|
|
|
{
|
|
|
|
ngx_int_t rc;
|
|
|
|
|
2005-12-05 10:18:09 -03:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http output filter \"%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 10:58:06 -04:00
|
|
|
|
2004-05-12 01:37:55 -04:00
|
|
|
rc = ngx_http_top_body_filter(r, in);
|
|
|
|
|
|
|
|
if (rc == NGX_ERROR) {
|
2005-02-09 11:31:07 -03:00
|
|
|
/* NGX_ERROR may be returned by any filter */
|
2005-12-05 10:18:09 -03:00
|
|
|
r->connection->error = 1;
|
2004-05-12 01:37:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-07 09:30:52 -04:00
|
|
|
u_char *
|
|
|
|
ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
|
2006-10-12 09:36:54 -04:00
|
|
|
size_t *root_length, size_t reserved)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
2006-03-15 05:53:04 -04:00
|
|
|
u_char *last;
|
|
|
|
size_t alias;
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-10-07 09:30:52 -04:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-10-07 09:30:52 -04:00
|
|
|
alias = clcf->alias ? clcf->name.len : 0;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2006-01-24 13:08:27 -03:00
|
|
|
if (alias && !r->valid_location) {
|
|
|
|
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
|
|
|
|
"\"alias\" could not be used in location \"%V\" "
|
|
|
|
"where URI was rewritten", &clcf->name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2006-03-15 05:53:04 -04:00
|
|
|
reserved += r->uri.len - alias + 1;
|
|
|
|
|
2005-12-28 11:23:52 -03:00
|
|
|
if (clcf->root_lengths == NULL) {
|
|
|
|
|
2006-10-12 09:36:54 -04:00
|
|
|
*root_length = clcf->root.len;
|
2005-12-28 11:23:52 -03:00
|
|
|
|
2006-03-15 05:53:04 -04:00
|
|
|
path->len = clcf->root.len + reserved;
|
2005-12-28 11:23:52 -03:00
|
|
|
|
|
|
|
path->data = ngx_palloc(r->pool, path->len);
|
|
|
|
if (path->data == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
last = ngx_copy(path->data, clcf->root.data, clcf->root.len);
|
|
|
|
|
2006-03-15 05:53:04 -04:00
|
|
|
} else {
|
2006-07-28 11:16:17 -04:00
|
|
|
if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved,
|
2006-08-09 15:59:45 -04:00
|
|
|
clcf->root_values->elts)
|
2006-07-28 11:16:17 -04:00
|
|
|
== NULL)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_conf_full_name((ngx_cycle_t *) ngx_cycle, path) == NGX_ERROR) {
|
2006-03-15 05:53:04 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
2005-12-28 11:23:52 -03:00
|
|
|
|
2006-10-12 09:36:54 -04:00
|
|
|
*root_length = path->len - reserved;
|
|
|
|
last = path->data + *root_length;
|
2005-12-28 11:23:52 -03:00
|
|
|
}
|
|
|
|
|
2006-03-15 05:53:04 -04:00
|
|
|
last = ngx_cpystrn(last, r->uri.data + alias, r->uri.len - alias + 1);
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2005-10-07 09:30:52 -04:00
|
|
|
return last;
|
2003-12-25 17:26:58 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-06 12:09:32 -04:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_auth_basic_user(ngx_http_request_t *r)
|
|
|
|
{
|
|
|
|
ngx_str_t auth, encoded;
|
|
|
|
ngx_uint_t len;
|
|
|
|
|
|
|
|
if (r->headers_in.user.len == 0 && r->headers_in.user.data != NULL) {
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->headers_in.authorization == NULL) {
|
|
|
|
r->headers_in.user.data = (u_char *) "";
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
encoded = r->headers_in.authorization->value;
|
|
|
|
|
|
|
|
if (encoded.len < sizeof("Basic ") - 1
|
2007-02-14 15:51:19 -03:00
|
|
|
|| ngx_strncasecmp(encoded.data, (u_char *) "Basic ",
|
|
|
|
sizeof("Basic ") - 1)
|
|
|
|
!= 0)
|
2005-09-06 12:09:32 -04:00
|
|
|
{
|
|
|
|
r->headers_in.user.data = (u_char *) "";
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
encoded.len -= sizeof("Basic ") - 1;
|
|
|
|
encoded.data += sizeof("Basic ") - 1;
|
|
|
|
|
|
|
|
while (encoded.len && encoded.data[0] == ' ') {
|
|
|
|
encoded.len--;
|
|
|
|
encoded.data++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (encoded.len == 0) {
|
|
|
|
r->headers_in.user.data = (u_char *) "";
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
2005-11-15 10:30:52 -03:00
|
|
|
|
2005-09-06 12:09:32 -04:00
|
|
|
auth.len = ngx_base64_decoded_length(encoded.len);
|
2005-11-15 10:30:52 -03:00
|
|
|
auth.data = ngx_palloc(r->pool, auth.len + 1);
|
2005-09-06 12:09:32 -04:00
|
|
|
if (auth.data == NULL) {
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_decode_base64(&auth, &encoded) != NGX_OK) {
|
|
|
|
r->headers_in.user.data = (u_char *) "";
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
2005-11-15 10:30:52 -03:00
|
|
|
|
2005-09-06 12:09:32 -04:00
|
|
|
auth.data[auth.len] = '\0';
|
2005-11-15 10:30:52 -03:00
|
|
|
|
|
|
|
for (len = 0; len < auth.len; len++) {
|
2005-09-06 12:09:32 -04:00
|
|
|
if (auth.data[len] == ':') {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-11-15 10:30:52 -03: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-09 14:25:55 -03:00
|
|
|
if (len == 0 || len == auth.len) {
|
2005-09-06 12:09:32 -04:00
|
|
|
r->headers_in.user.data = (u_char *) "";
|
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->headers_in.user.len = len;
|
|
|
|
r->headers_in.user.data = auth.data;
|
|
|
|
r->headers_in.passwd.len = auth.len - len - 1;
|
|
|
|
r->headers_in.passwd.data = &auth.data[len + 1];
|
|
|
|
|
|
|
|
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 10:58:06 -04:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_subrequest(ngx_http_request_t *r,
|
2006-10-10 10:30:39 -04:00
|
|
|
ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr,
|
2006-10-13 11:20:10 -04:00
|
|
|
ngx_http_post_subrequest_t *ps, ngx_uint_t flags)
|
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 10:58:06 -04:00
|
|
|
{
|
2005-12-05 10:18:09 -03: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 10:58:06 -04:00
|
|
|
ngx_http_request_t *sr;
|
2006-07-11 09:20:19 -04: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 10:58:06 -04:00
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
|
|
|
ngx_http_postponed_request_t *pr, *p;
|
|
|
|
|
2006-06-28 12:00:26 -04:00
|
|
|
r->main->subrequests--;
|
|
|
|
|
|
|
|
if (r->main->subrequests == 0) {
|
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
2006-08-28 12:57:48 -04:00
|
|
|
"subrequests cycle while processing \"%V\"", uri);
|
2006-11-02 10:48:28 -03:00
|
|
|
r->main->subrequests = 1;
|
2006-06-28 12:00:26 -04:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
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 10:58:06 -04:00
|
|
|
sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t));
|
|
|
|
if (sr == NULL) {
|
2006-05-04 11:32:46 -04:00
|
|
|
return NGX_ERROR;
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
sr->signature = NGX_HTTP_MODULE;
|
2005-12-05 10:18:09 -03:00
|
|
|
|
|
|
|
c = r->connection;
|
|
|
|
sr->connection = 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 10:58:06 -04:00
|
|
|
|
|
|
|
sr->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (sr->ctx == NULL) {
|
2006-05-04 11:32:46 -04:00
|
|
|
return NGX_ERROR;
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_list_init(&sr->headers_out.headers, r->pool, 20,
|
2005-11-26 07:11:11 -03:00
|
|
|
sizeof(ngx_table_elt_t))
|
|
|
|
== NGX_ERROR)
|
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 10:58:06 -04:00
|
|
|
{
|
2006-05-04 11:32:46 -04:00
|
|
|
return NGX_ERROR;
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
|
|
|
sr->main_conf = cscf->ctx->main_conf;
|
|
|
|
sr->srv_conf = cscf->ctx->srv_conf;
|
|
|
|
sr->loc_conf = cscf->ctx->loc_conf;
|
|
|
|
|
|
|
|
sr->pool = r->pool;
|
|
|
|
|
|
|
|
sr->headers_in = r->headers_in;
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
ngx_http_clear_content_length(sr);
|
|
|
|
ngx_http_clear_accept_ranges(sr);
|
|
|
|
ngx_http_clear_last_modified(sr);
|
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 10:58:06 -04:00
|
|
|
|
|
|
|
sr->request_body = r->request_body;
|
|
|
|
|
|
|
|
sr->method = NGX_HTTP_GET;
|
|
|
|
sr->http_version = r->http_version;
|
|
|
|
|
|
|
|
sr->request_line = r->request_line;
|
|
|
|
sr->uri = *uri;
|
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-09 14:25:55 -03: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 10:58:06 -04:00
|
|
|
if (args) {
|
|
|
|
sr->args = *args;
|
|
|
|
}
|
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-09 14:25:55 -03:00
|
|
|
|
2005-12-05 10:18:09 -03:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
|
|
|
"http subrequest \"%V?%V\"", uri, &sr->args);
|
|
|
|
|
2006-10-13 11:20:10 -04:00
|
|
|
sr->zero_in_uri = (flags & NGX_HTTP_ZERO_IN_URI) != 0;
|
|
|
|
sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0;
|
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-09 14:25:55 -03: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 10:58:06 -04:00
|
|
|
sr->unparsed_uri = r->unparsed_uri;
|
|
|
|
sr->method_name = r->method_name;
|
|
|
|
sr->http_protocol = r->http_protocol;
|
|
|
|
|
|
|
|
if (ngx_http_set_exten(sr) != NGX_OK) {
|
2006-05-04 11:32:46 -04:00
|
|
|
return NGX_ERROR;
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
2005-10-04 06:38:53 -04:00
|
|
|
sr->main = 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 10:58:06 -04:00
|
|
|
sr->parent = r;
|
2006-10-13 11:20:10 -04:00
|
|
|
sr->post_subrequest = ps;
|
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 10:58:06 -04:00
|
|
|
sr->read_event_handler = ngx_http_request_empty_handler;
|
|
|
|
sr->write_event_handler = ngx_http_request_empty_handler;
|
|
|
|
|
2005-12-05 10:18:09 -03:00
|
|
|
if (c->data == r) {
|
|
|
|
c->data = sr;
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
sr->in_addr = r->in_addr;
|
|
|
|
sr->port = r->port;
|
|
|
|
sr->port_text = r->port_text;
|
|
|
|
sr->server_name = r->server_name;
|
|
|
|
|
|
|
|
sr->variables = r->variables;
|
|
|
|
|
|
|
|
sr->log_handler = r->log_handler;
|
|
|
|
|
|
|
|
pr = ngx_palloc(r->pool, sizeof(ngx_http_postponed_request_t));
|
|
|
|
if (pr == NULL) {
|
2006-05-04 11:32:46 -04:00
|
|
|
return NGX_ERROR;
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
pr->request = sr;
|
|
|
|
pr->out = NULL;
|
|
|
|
pr->next = NULL;
|
|
|
|
|
|
|
|
if (r->postponed) {
|
|
|
|
for (p = r->postponed; p->next; p = p->next) { /* void */ }
|
|
|
|
p->next = pr;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
r->postponed = pr;
|
|
|
|
}
|
|
|
|
|
2006-07-11 09:20:19 -04:00
|
|
|
ctx = c->log->data;
|
|
|
|
ctx->current_request = sr;
|
|
|
|
|
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 10:58:06 -04:00
|
|
|
sr->internal = 1;
|
2006-01-11 12:26:57 -03:00
|
|
|
sr->fast_subrequest = 1;
|
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 10:58:06 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
sr->discard_body = r->discard_body;
|
2005-05-16 09:53:20 -04:00
|
|
|
sr->main_filter_need_in_memory = r->main_filter_need_in_memory;
|
|
|
|
|
2006-05-23 10:54:58 -04:00
|
|
|
sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;
|
|
|
|
|
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 10:58:06 -04:00
|
|
|
ngx_http_handler(sr);
|
|
|
|
|
2005-12-05 10:18:09 -03:00
|
|
|
if (!c->destroyed) {
|
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
|
|
|
|
"http subrequest done \"%V?%V\"", uri, &sr->args);
|
2006-05-04 11:32:46 -04:00
|
|
|
|
2006-11-02 10:38:25 -03:00
|
|
|
r->main->subrequests++;
|
|
|
|
|
2006-10-10 10:30:39 -04:00
|
|
|
*psr = sr;
|
|
|
|
|
2006-05-04 11:32:46 -04:00
|
|
|
if (sr->fast_subrequest) {
|
|
|
|
sr->fast_subrequest = 0;
|
|
|
|
|
|
|
|
if (sr->done) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_AGAIN;
|
2005-12-05 10:18:09 -03: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 10:58:06 -04:00
|
|
|
|
2006-10-13 11:20:10 -04:00
|
|
|
return NGX_DONE;
|
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 10:58:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_internal_redirect(ngx_http_request_t *r,
|
|
|
|
ngx_str_t *uri, ngx_str_t *args)
|
2003-12-25 17:26:58 -03:00
|
|
|
{
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
|
|
|
|
2006-08-18 10:17:54 -04:00
|
|
|
r->uri_changes--;
|
|
|
|
|
|
|
|
if (r->uri_changes == 0) {
|
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
2006-08-28 12:57:48 -04:00
|
|
|
"rewrite or internal redirection cycle "
|
|
|
|
"while internal redirect to \"%V\"", uri);
|
|
|
|
|
2006-08-18 10:17:54 -04:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return NGX_DONE;
|
|
|
|
}
|
|
|
|
|
2004-11-11 11:07:14 -03:00
|
|
|
r->uri = *uri;
|
2003-12-25 17:26:58 -03:00
|
|
|
|
|
|
|
if (args) {
|
2004-11-11 11:07:14 -03:00
|
|
|
r->args = *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 10:58:06 -04:00
|
|
|
|
|
|
|
} else {
|
|
|
|
r->args.len = 0;
|
|
|
|
r->args.data = NULL;
|
2003-12-25 17:26:58 -03:00
|
|
|
}
|
|
|
|
|
2005-12-05 10:18:09 -03:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"internal redirect: \"%V?%V\"", uri, &r->args);
|
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
if (ngx_http_set_exten(r) != NGX_OK) {
|
2006-08-18 10:17:54 -04:00
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return NGX_DONE;
|
2003-12-25 17:26:58 -03:00
|
|
|
}
|
|
|
|
|
2006-08-16 09:09:33 -04:00
|
|
|
/* clear the modules contexts */
|
|
|
|
ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
|
2003-10-12 13:49:16 -03:00
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
|
|
|
r->loc_conf = cscf->ctx->loc_conf;
|
|
|
|
|
2005-08-23 11:36:54 -04:00
|
|
|
ngx_http_update_location_config(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 10:58:06 -04:00
|
|
|
r->internal = 1;
|
|
|
|
|
2003-05-14 13:13:13 -04:00
|
|
|
ngx_http_handler(r);
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2003-10-21 04:47:21 -03:00
|
|
|
return NGX_DONE;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-24 12:09:41 -03:00
|
|
|
ngx_http_cleanup_t *
|
|
|
|
ngx_http_cleanup_add(ngx_http_request_t *r, size_t size)
|
2003-10-12 13:49:16 -03:00
|
|
|
{
|
2005-10-24 12:09:41 -03:00
|
|
|
ngx_http_cleanup_t *cln;
|
2003-10-12 13:49:16 -03:00
|
|
|
|
2005-10-24 12:09:41 -03:00
|
|
|
r = r->main;
|
|
|
|
|
|
|
|
cln = ngx_palloc(r->pool, sizeof(ngx_http_cleanup_t));
|
|
|
|
if (cln == NULL) {
|
|
|
|
return NULL;
|
2003-10-12 13:49:16 -03:00
|
|
|
}
|
|
|
|
|
2005-10-24 12:09:41 -03:00
|
|
|
if (size) {
|
|
|
|
cln->data = ngx_palloc(r->pool, size);
|
|
|
|
if (cln->data == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2003-10-12 13:49:16 -03:00
|
|
|
|
2005-10-24 12:09:41 -03:00
|
|
|
} else {
|
|
|
|
cln->data = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cln->handler = NULL;
|
|
|
|
cln->next = r->cleanup;
|
|
|
|
|
|
|
|
r->cleanup = cln;
|
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http cleanup add: %p", cln);
|
|
|
|
|
|
|
|
return cln;
|
|
|
|
}
|
2003-10-12 13:49:16 -03:00
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
2005-02-09 11:31:07 -03:00
|
|
|
char *rv;
|
|
|
|
void *mconf;
|
2005-06-07 11:56:31 -04:00
|
|
|
ngx_uint_t m;
|
|
|
|
ngx_conf_t pcf;
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_http_module_t *module;
|
|
|
|
ngx_http_conf_ctx_t *ctx, *http_ctx;
|
|
|
|
ngx_http_core_srv_conf_t *cscf, **cscfp;
|
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
|
|
|
|
if (ctx == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
http_ctx = cf->ctx;
|
|
|
|
ctx->main_conf = http_ctx->main_conf;
|
2003-05-16 11:27:48 -04:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
/* the server{}'s srv_conf */
|
2003-05-16 11:27:48 -04:00
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (ctx->srv_conf == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
/* the server{}'s loc_conf */
|
2003-05-16 11:27:48 -04:00
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (ctx->loc_conf == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2003-05-20 11:37:55 -04:00
|
|
|
for (m = 0; ngx_modules[m]; m++) {
|
2003-05-27 08:18:54 -04:00
|
|
|
if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
|
2003-01-09 02:36:00 -03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
module = ngx_modules[m]->ctx;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
|
|
|
if (module->create_srv_conf) {
|
2005-03-19 08:38:37 -04:00
|
|
|
mconf = module->create_srv_conf(cf);
|
|
|
|
if (mconf == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx->srv_conf[ngx_modules[m]->ctx_index] = mconf;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (module->create_loc_conf) {
|
2005-03-19 08:38:37 -04:00
|
|
|
mconf = module->create_loc_conf(cf);
|
|
|
|
if (mconf == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx->loc_conf[ngx_modules[m]->ctx_index] = mconf;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
|
|
|
|
/* the server configuration context */
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
cscf = ctx->srv_conf[ngx_http_core_module.ctx_index];
|
2003-05-19 12:39:14 -04:00
|
|
|
cscf->ctx = ctx;
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
cscfp = ngx_array_push(&cmcf->servers);
|
|
|
|
if (cscfp == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
*cscfp = cscf;
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
/* parse inside server{} */
|
|
|
|
|
2005-06-07 11:56:31 -04:00
|
|
|
pcf = *cf;
|
2003-01-09 02:36:00 -03:00
|
|
|
cf->ctx = ctx;
|
2003-05-14 13:13:13 -04:00
|
|
|
cf->cmd_type = NGX_HTTP_SRV_CONF;
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
rv = ngx_conf_parse(cf, NULL);
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2005-06-07 11:56:31 -04:00
|
|
|
*cf = pcf;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2003-05-29 09:02:09 -04:00
|
|
|
if (rv != NGX_CONF_OK) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2003-11-21 03:30:49 -03:00
|
|
|
ngx_qsort(cscf->locations.elts, (size_t) cscf->locations.nelts,
|
2005-02-03 16:33:37 -03:00
|
|
|
sizeof(ngx_http_core_loc_conf_t *), ngx_http_core_cmp_locations);
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
return rv;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
|
|
|
char *rv;
|
2003-11-25 17:44:56 -03:00
|
|
|
ngx_int_t m;
|
2004-03-09 16:47:07 -03:00
|
|
|
ngx_str_t *value;
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_conf_t save;
|
2003-01-09 02:36:00 -03:00
|
|
|
ngx_http_module_t *module;
|
2004-07-18 15:11:20 -04:00
|
|
|
ngx_http_conf_ctx_t *ctx, *pctx;
|
2003-05-19 12:39:14 -04:00
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2004-07-18 15:11:20 -04:00
|
|
|
ngx_http_core_loc_conf_t *clcf, *pclcf, **clcfp;
|
2004-10-21 12:34:38 -03:00
|
|
|
#if (NGX_PCRE)
|
2004-03-09 16:47:07 -03:00
|
|
|
ngx_str_t err;
|
2004-03-16 03:10:12 -04:00
|
|
|
u_char errstr[NGX_MAX_CONF_ERRSTR];
|
2004-03-09 16:47:07 -03:00
|
|
|
#endif
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
|
|
|
|
if (ctx == NULL) {
|
2003-11-25 17:44:56 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
pctx = cf->ctx;
|
|
|
|
ctx->main_conf = pctx->main_conf;
|
|
|
|
ctx->srv_conf = pctx->srv_conf;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2003-11-25 17:44:56 -03:00
|
|
|
ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (ctx->loc_conf == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
for (m = 0; ngx_modules[m]; m++) {
|
|
|
|
if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
|
2003-01-09 02:36:00 -03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
module = ngx_modules[m]->ctx;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
|
|
|
if (module->create_loc_conf) {
|
2003-11-25 17:44:56 -03:00
|
|
|
ctx->loc_conf[ngx_modules[m]->ctx_index] =
|
|
|
|
module->create_loc_conf(cf);
|
|
|
|
if (ctx->loc_conf[ngx_modules[m]->ctx_index] == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
clcf = ctx->loc_conf[ngx_http_core_module.ctx_index];
|
2003-05-19 12:39:14 -04:00
|
|
|
clcf->loc_conf = ctx->loc_conf;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
value = cf->args->elts;
|
2003-11-25 17:44:56 -03:00
|
|
|
|
|
|
|
if (cf->args->nelts == 3) {
|
|
|
|
if (value[1].len == 1 && value[1].data[0] == '=') {
|
2004-11-11 17:58:09 -03:00
|
|
|
clcf->name = value[2];
|
2003-11-25 17:44:56 -03:00
|
|
|
clcf->exact_match = 1;
|
|
|
|
|
2004-11-20 16:52:20 -03:00
|
|
|
} else if (value[1].len == 2
|
|
|
|
&& value[1].data[0] == '^'
|
|
|
|
&& value[1].data[1] == '~')
|
|
|
|
{
|
|
|
|
clcf->name = value[2];
|
|
|
|
clcf->noregex = 1;
|
|
|
|
|
2003-11-25 17:44:56 -03:00
|
|
|
} else if ((value[1].len == 1 && value[1].data[0] == '~')
|
|
|
|
|| (value[1].len == 2
|
|
|
|
&& value[1].data[0] == '~'
|
|
|
|
&& value[1].data[1] == '*'))
|
|
|
|
{
|
2004-10-21 12:34:38 -03:00
|
|
|
#if (NGX_PCRE)
|
2003-11-25 17:44:56 -03:00
|
|
|
err.len = NGX_MAX_CONF_ERRSTR;
|
|
|
|
err.data = errstr;
|
|
|
|
|
|
|
|
clcf->regex = ngx_regex_compile(&value[2],
|
|
|
|
value[1].len == 2 ? NGX_REGEX_CASELESS: 0,
|
|
|
|
cf->pool, &err);
|
|
|
|
|
|
|
|
if (clcf->regex == NULL) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
clcf->name = value[2];
|
2003-12-14 17:10:27 -03:00
|
|
|
#else
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"the using of the regex \"%V\" "
|
|
|
|
"requires PCRE library", &value[2]);
|
2003-12-14 17:10:27 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
#endif
|
2003-11-25 17:44:56 -03:00
|
|
|
|
|
|
|
} else {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"invalid location modifier \"%V\"", &value[1]);
|
2003-11-25 17:44:56 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2004-11-11 17:58:09 -03:00
|
|
|
clcf->name = value[1];
|
2003-11-25 17:44:56 -03:00
|
|
|
}
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index];
|
|
|
|
|
|
|
|
if (pclcf->name.len == 0) {
|
|
|
|
cscf = ctx->srv_conf[ngx_http_core_module.ctx_index];
|
2005-03-19 08:38:37 -04:00
|
|
|
|
|
|
|
clcfp = ngx_array_push(&cscf->locations);
|
|
|
|
if (clcfp == NULL) {
|
2004-07-18 15:11:20 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2005-02-03 16:33:37 -03:00
|
|
|
#if 0
|
2004-07-18 15:11:20 -04:00
|
|
|
clcf->prev_location = pclcf;
|
2005-02-03 16:33:37 -03:00
|
|
|
#endif
|
2004-07-18 15:11:20 -04:00
|
|
|
|
|
|
|
if (pclcf->exact_match) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"location \"%V\" could not be inside "
|
|
|
|
"the exact location \"%V\"",
|
|
|
|
&clcf->name, &pclcf->name);
|
2004-07-18 15:11:20 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
#if (NGX_PCRE)
|
2004-07-18 15:11:20 -04:00
|
|
|
if (clcf->regex == NULL
|
|
|
|
&& ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
|
|
|
|
!= 0)
|
2004-07-26 12:21:18 -04:00
|
|
|
#else
|
|
|
|
if (ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
|
|
|
|
!= 0)
|
|
|
|
#endif
|
2004-07-18 15:11:20 -04:00
|
|
|
{
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"location \"%V\" is outside location \"%V\"",
|
|
|
|
&clcf->name, &pclcf->name);
|
2004-07-18 15:11:20 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pclcf->locations.elts == NULL) {
|
2005-03-19 08:38:37 -04:00
|
|
|
if (ngx_array_init(&pclcf->locations, cf->pool, 4, sizeof(void *))
|
|
|
|
!= NGX_OK)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2004-07-18 15:11:20 -04:00
|
|
|
}
|
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
clcfp = ngx_array_push(&pclcf->locations);
|
|
|
|
if (clcfp == NULL) {
|
2004-07-18 15:11:20 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-11-25 17:44:56 -03:00
|
|
|
}
|
2004-07-18 15:11:20 -04:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
*clcfp = clcf;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
save = *cf;
|
2003-01-09 02:36:00 -03:00
|
|
|
cf->ctx = ctx;
|
2003-05-14 13:13:13 -04:00
|
|
|
cf->cmd_type = NGX_HTTP_LOC_CONF;
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
rv = ngx_conf_parse(cf, NULL);
|
2005-02-03 16:33:37 -03:00
|
|
|
|
|
|
|
*cf = save;
|
|
|
|
|
|
|
|
if (rv != NGX_CONF_OK) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_qsort(clcf->locations.elts, (size_t) clcf->locations.nelts,
|
|
|
|
sizeof(ngx_http_core_loc_conf_t *), ngx_http_core_cmp_locations);
|
2003-05-14 13:13:13 -04:00
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-22 12:02:46 -04:00
|
|
|
static int ngx_libc_cdecl
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_http_core_cmp_locations(const void *one, const void *two)
|
2005-02-03 16:33:37 -03:00
|
|
|
{
|
|
|
|
ngx_int_t rc;
|
|
|
|
ngx_http_core_loc_conf_t *first, *second;
|
|
|
|
|
|
|
|
first = *(ngx_http_core_loc_conf_t **) one;
|
|
|
|
second = *(ngx_http_core_loc_conf_t **) two;
|
|
|
|
|
|
|
|
if (first->noname && !second->noname) {
|
|
|
|
/* shift no named locations to the end */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!first->noname && second->noname) {
|
|
|
|
/* shift no named locations to the end */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (first->noname || second->noname) {
|
|
|
|
/* do not sort no named locations */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if (NGX_PCRE)
|
|
|
|
|
|
|
|
if (first->regex && !second->regex) {
|
|
|
|
/* shift the regex matches to the end */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!first->regex && second->regex) {
|
|
|
|
/* shift the regex matches to the end */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (first->regex || second->regex) {
|
|
|
|
/* do not sort the regex matches */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rc = ngx_strcmp(first->name.data, second->name.data);
|
|
|
|
|
|
|
|
if (rc == 0 && second->exact_match) {
|
|
|
|
/* an exact match must be before the same inclusive one */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (int) rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2003-05-14 13:13:13 -04:00
|
|
|
{
|
2006-04-19 11:30:56 -04:00
|
|
|
ngx_http_core_loc_conf_t *lcf = conf;
|
|
|
|
|
2003-05-30 10:27:59 -04:00
|
|
|
char *rv;
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_conf_t save;
|
2003-05-30 10:27:59 -04:00
|
|
|
|
2006-04-19 11:30:56 -04:00
|
|
|
if (lcf->types == NULL) {
|
|
|
|
lcf->types = ngx_array_create(cf->pool, 64, sizeof(ngx_hash_key_t));
|
|
|
|
if (lcf->types == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
save = *cf;
|
|
|
|
cf->handler = ngx_http_core_type;
|
2003-05-30 10:27:59 -04:00
|
|
|
cf->handler_conf = conf;
|
2005-02-03 16:33:37 -03:00
|
|
|
|
2003-05-30 10:27:59 -04:00
|
|
|
rv = ngx_conf_parse(cf, NULL);
|
2005-02-03 16:33:37 -03:00
|
|
|
|
|
|
|
*cf = save;
|
2003-05-30 10:27:59 -04:00
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
|
2003-05-30 10:27:59 -04:00
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *lcf = conf;
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2007-03-29 06:27:24 -04:00
|
|
|
ngx_str_t *value, *content_type, *old, file;
|
2005-12-16 12:07:08 -03:00
|
|
|
ngx_uint_t i, n;
|
|
|
|
ngx_hash_key_t *type;
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2007-03-29 06:27:24 -04:00
|
|
|
value = cf->args->elts;
|
|
|
|
|
|
|
|
if (ngx_strcmp(value[0].data, "include") == 0) {
|
|
|
|
file = value[1];
|
|
|
|
|
|
|
|
if (ngx_conf_full_name(cf->cycle, &file) == NGX_ERROR){
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
|
|
|
|
|
|
|
|
return ngx_conf_parse(cf, &file);
|
|
|
|
}
|
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t));
|
|
|
|
if (content_type == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
2003-05-14 13:13:13 -04:00
|
|
|
}
|
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
*content_type = value[0];
|
2003-05-14 13:13:13 -04:00
|
|
|
|
|
|
|
for (i = 1; i < cf->args->nelts; i++) {
|
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
for (n = 0; n < value[i].len; n++) {
|
|
|
|
value[i].data[n] = ngx_tolower(value[i].data[n]);
|
|
|
|
}
|
|
|
|
|
|
|
|
type = lcf->types->elts;
|
|
|
|
for (n = 0; n < lcf->types->nelts; n++) {
|
|
|
|
if (ngx_strcmp(value[i].data, type[n].key.data) == 0) {
|
|
|
|
old = type[n].value;
|
|
|
|
type[n].value = content_type;
|
|
|
|
|
|
|
|
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
|
|
"duplicate extention \"%V\", "
|
|
|
|
"content type: \"%V\", "
|
|
|
|
"old content type: \"%V\"",
|
|
|
|
&value[i], content_type, old);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type = ngx_array_push(lcf->types);
|
2005-03-19 08:38:37 -04:00
|
|
|
if (type == NULL) {
|
2004-09-14 15:39:54 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
type->key = value[i];
|
|
|
|
type->key_hash = ngx_hash_key(value[i].data, value[i].len);
|
|
|
|
type->value = content_type;
|
2003-05-14 13:13:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_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 10:58:06 -04:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_core_preconfiguration(ngx_conf_t *cf)
|
|
|
|
{
|
|
|
|
return ngx_http_variables_add_core_vars(cf);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static void *
|
|
|
|
ngx_http_core_create_main_conf(ngx_conf_t *cf)
|
2003-05-19 12:39:14 -04:00
|
|
|
{
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
cmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_main_conf_t));
|
|
|
|
if (cmcf == NULL) {
|
2005-02-03 16:33:37 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2005-03-04 11:06:57 -03:00
|
|
|
if (ngx_array_init(&cmcf->servers, cf->pool, 4,
|
2005-10-24 12:09:41 -03:00
|
|
|
sizeof(ngx_http_core_srv_conf_t *))
|
2006-05-23 10:54:58 -04:00
|
|
|
!= NGX_OK)
|
2005-02-03 16:33:37 -03:00
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
cmcf->server_names_hash_max_size = NGX_CONF_UNSET_UINT;
|
|
|
|
cmcf->server_names_hash_bucket_size = NGX_CONF_UNSET_UINT;
|
2004-12-21 09:30:30 -03:00
|
|
|
|
2006-02-08 12:33:12 -03:00
|
|
|
cmcf->variables_hash_max_size = NGX_CONF_UNSET_UINT;
|
|
|
|
cmcf->variables_hash_bucket_size = NGX_CONF_UNSET_UINT;
|
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
return cmcf;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf)
|
2003-05-19 12:39:14 -04:00
|
|
|
{
|
2003-05-27 08:18:54 -04:00
|
|
|
ngx_http_core_main_conf_t *cmcf = conf;
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
if (cmcf->server_names_hash_max_size == NGX_CONF_UNSET_UINT) {
|
|
|
|
cmcf->server_names_hash_max_size = 512;
|
2004-12-21 09:30:30 -03:00
|
|
|
}
|
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
if (cmcf->server_names_hash_bucket_size == NGX_CONF_UNSET_UINT) {
|
|
|
|
cmcf->server_names_hash_bucket_size = ngx_cacheline_size;
|
2004-12-21 09:30:30 -03:00
|
|
|
}
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
cmcf->server_names_hash_bucket_size =
|
|
|
|
ngx_align(cmcf->server_names_hash_bucket_size, ngx_cacheline_size);
|
|
|
|
|
2006-02-08 12:33:12 -03:00
|
|
|
|
|
|
|
if (cmcf->variables_hash_max_size == NGX_CONF_UNSET_UINT) {
|
|
|
|
cmcf->variables_hash_max_size = 512;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmcf->variables_hash_bucket_size == NGX_CONF_UNSET_UINT) {
|
|
|
|
cmcf->variables_hash_bucket_size = 64;
|
|
|
|
}
|
|
|
|
|
|
|
|
cmcf->variables_hash_bucket_size =
|
|
|
|
ngx_align(cmcf->variables_hash_bucket_size, ngx_cacheline_size);
|
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static void *
|
|
|
|
ngx_http_core_create_srv_conf(ngx_conf_t *cf)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
2003-05-19 12:39:14 -04:00
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
cscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_srv_conf_t));
|
|
|
|
if (cscf == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-09-22 12:18:21 -04: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 10:03:58 -03:00
|
|
|
* set by ngx_pcalloc():
|
2005-02-09 11:31:07 -03: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 10:03:58 -03:00
|
|
|
* conf->client_large_buffers.num = 0;
|
|
|
|
*/
|
2004-09-22 12:18:21 -04:00
|
|
|
|
2005-03-04 11:06:57 -03:00
|
|
|
if (ngx_array_init(&cscf->locations, cf->pool, 4, sizeof(void *))
|
2005-12-26 14:07:48 -03:00
|
|
|
== NGX_ERROR)
|
2005-02-09 11:31:07 -03:00
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-03-04 11:06:57 -03:00
|
|
|
if (ngx_array_init(&cscf->listen, cf->pool, 4, sizeof(ngx_http_listen_t))
|
2005-12-26 14:07:48 -03:00
|
|
|
== NGX_ERROR)
|
2005-02-09 11:31:07 -03:00
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-08-30 06:39:17 -04:00
|
|
|
if (ngx_array_init(&cscf->server_names, cf->temp_pool, 4,
|
2005-12-26 14:07:48 -03:00
|
|
|
sizeof(ngx_http_server_name_t))
|
|
|
|
== NGX_ERROR)
|
2005-02-09 11:31:07 -03:00
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
cscf->connection_pool_size = NGX_CONF_UNSET_SIZE;
|
|
|
|
cscf->request_pool_size = NGX_CONF_UNSET_SIZE;
|
|
|
|
cscf->client_header_timeout = NGX_CONF_UNSET_MSEC;
|
|
|
|
cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE;
|
2006-02-03 09:58:48 -03:00
|
|
|
cscf->optimize_server_names = NGX_CONF_UNSET;
|
2005-05-14 14:42:03 -04:00
|
|
|
cscf->ignore_invalid_headers = NGX_CONF_UNSET;
|
2003-05-23 07:53:01 -04:00
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
return cscf;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
2003-05-30 10:27:59 -04:00
|
|
|
ngx_http_core_srv_conf_t *prev = parent;
|
|
|
|
ngx_http_core_srv_conf_t *conf = child;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
ngx_http_listen_t *ls;
|
|
|
|
ngx_http_server_name_t *sn;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2003-06-02 11:24:30 -04:00
|
|
|
/* TODO: it does not merge, it inits only */
|
2003-05-19 12:39:14 -04:00
|
|
|
|
|
|
|
if (conf->listen.nelts == 0) {
|
2005-03-19 08:38:37 -04:00
|
|
|
ls = ngx_array_push(&conf->listen);
|
|
|
|
if (ls == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
ngx_memzero(ls, sizeof(ngx_http_listen_t));
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ls->addr = INADDR_ANY;
|
2004-11-11 11:07:14 -03:00
|
|
|
#if (NGX_WIN32)
|
2005-02-09 11:31:07 -03:00
|
|
|
ls->port = 80;
|
2003-06-03 11:42:58 -04:00
|
|
|
#else
|
2003-06-02 11:24:30 -04:00
|
|
|
/* STUB: getuid() should be cached */
|
2005-02-09 11:31:07 -03:00
|
|
|
ls->port = (getuid() == 0) ? 80 : 8000;
|
2003-06-03 11:42:58 -04:00
|
|
|
#endif
|
2005-02-09 11:31:07 -03:00
|
|
|
ls->family = AF_INET;
|
2005-10-24 12:09:41 -03:00
|
|
|
|
|
|
|
ls->conf.backlog = -1;
|
|
|
|
ls->conf.rcvbuf = -1;
|
|
|
|
ls->conf.sndbuf = -1;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
2006-02-01 15:22:15 -03:00
|
|
|
if (conf->server_name.data == NULL) {
|
|
|
|
conf->server_name.data = ngx_palloc(cf->pool, NGX_MAXHOSTNAMELEN);
|
|
|
|
if (conf->server_name.data == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2006-02-01 15:22:15 -03:00
|
|
|
if (gethostname((char *) conf->server_name.data, NGX_MAXHOSTNAMELEN)
|
|
|
|
== -1)
|
|
|
|
{
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
|
|
|
|
"gethostname() failed");
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-02-01 15:22:15 -03:00
|
|
|
conf->server_name.len = ngx_strlen(conf->server_name.data);
|
|
|
|
|
|
|
|
sn = ngx_array_push(&conf->server_names);
|
|
|
|
if (sn == NULL) {
|
2003-07-18 10:44:05 -04:00
|
|
|
return NGX_CONF_ERROR;
|
2003-01-15 04:02:27 -03:00
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2006-02-01 15:22:15 -03:00
|
|
|
sn->name.len = conf->server_name.len;
|
|
|
|
sn->name.data = conf->server_name.data;
|
2005-02-09 11:31:07 -03:00
|
|
|
sn->core_srv_conf = conf;
|
2003-01-15 04:02:27 -03:00
|
|
|
}
|
|
|
|
|
2003-06-11 11:28:34 -04:00
|
|
|
ngx_conf_merge_size_value(conf->connection_pool_size,
|
2004-10-01 11:53:53 -04:00
|
|
|
prev->connection_pool_size, 256);
|
2003-05-23 07:53:01 -04:00
|
|
|
ngx_conf_merge_size_value(conf->request_pool_size,
|
2004-10-01 11:53:53 -04:00
|
|
|
prev->request_pool_size, 4096);
|
2003-05-23 07:53:01 -04:00
|
|
|
ngx_conf_merge_msec_value(conf->client_header_timeout,
|
|
|
|
prev->client_header_timeout, 60000);
|
|
|
|
ngx_conf_merge_size_value(conf->client_header_buffer_size,
|
|
|
|
prev->client_header_buffer_size, 1024);
|
2004-09-23 02:32:00 -04:00
|
|
|
ngx_conf_merge_bufs_value(conf->large_client_header_buffers,
|
|
|
|
prev->large_client_header_buffers,
|
|
|
|
4, ngx_pagesize);
|
|
|
|
|
|
|
|
if (conf->large_client_header_buffers.size < conf->connection_pool_size) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"the \"large_client_header_buffers\" size must be "
|
|
|
|
"equal to or bigger than \"connection_pool_size\"");
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-02-03 09:58:48 -03:00
|
|
|
ngx_conf_merge_value(conf->optimize_server_names,
|
|
|
|
prev->optimize_server_names, 1);
|
2006-01-24 13:08:27 -03:00
|
|
|
|
2005-05-14 14:42:03 -04:00
|
|
|
ngx_conf_merge_value(conf->ignore_invalid_headers,
|
|
|
|
prev->ignore_invalid_headers, 1);
|
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static void *
|
|
|
|
ngx_http_core_create_loc_conf(ngx_conf_t *cf)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_core_loc_conf_t *lcf;
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_loc_conf_t));
|
|
|
|
if (lcf == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-09 02:36:00 -03: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 10:03:58 -03:00
|
|
|
/*
|
|
|
|
* set by ngx_pcalloc():
|
|
|
|
*
|
2005-11-15 10:30:52 -03:00
|
|
|
* lcf->root = { 0, NULL };
|
2006-04-07 10:08:04 -04:00
|
|
|
* lcf->limit_except = 0;
|
2005-11-15 10:30:52 -03:00
|
|
|
* lcf->post_action = { 0, NULL };
|
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 10:03:58 -03:00
|
|
|
* lcf->types = NULL;
|
2005-11-15 10:30:52 -03:00
|
|
|
* lcf->default_type = { 0, NULL };
|
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 10:03:58 -03:00
|
|
|
* lcf->err_log = NULL;
|
|
|
|
* lcf->error_pages = NULL;
|
|
|
|
* lcf->client_body_path = NULL;
|
|
|
|
* lcf->regex = NULL;
|
|
|
|
* lcf->exact_match = 0;
|
|
|
|
* lcf->auto_redirect = 0;
|
|
|
|
* lcf->alias = 0;
|
|
|
|
*/
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2006-07-07 12:33:19 -04:00
|
|
|
lcf->client_max_body_size = NGX_CONF_UNSET;
|
2004-04-01 12:20:53 -04:00
|
|
|
lcf->client_body_buffer_size = NGX_CONF_UNSET_SIZE;
|
2004-03-16 03:10:12 -04:00
|
|
|
lcf->client_body_timeout = NGX_CONF_UNSET_MSEC;
|
2005-09-23 07:02:22 -04:00
|
|
|
lcf->satisfy_any = NGX_CONF_UNSET;
|
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 10:58:06 -04:00
|
|
|
lcf->internal = NGX_CONF_UNSET;
|
2006-04-14 05:53:38 -04:00
|
|
|
lcf->client_body_in_file_only = NGX_CONF_UNSET;
|
2003-10-22 04:05:29 -03:00
|
|
|
lcf->sendfile = NGX_CONF_UNSET;
|
2007-05-07 02:33:39 -04:00
|
|
|
lcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE;
|
2004-01-05 17:55:48 -03:00
|
|
|
lcf->tcp_nopush = NGX_CONF_UNSET;
|
2004-10-11 12:07:03 -03:00
|
|
|
lcf->tcp_nodelay = NGX_CONF_UNSET;
|
2004-03-16 03:10:12 -04:00
|
|
|
lcf->send_timeout = NGX_CONF_UNSET_MSEC;
|
|
|
|
lcf->send_lowat = NGX_CONF_UNSET_SIZE;
|
2004-07-14 12:01:42 -04:00
|
|
|
lcf->postpone_output = NGX_CONF_UNSET_SIZE;
|
|
|
|
lcf->limit_rate = NGX_CONF_UNSET_SIZE;
|
2004-03-16 03:10:12 -04:00
|
|
|
lcf->keepalive_timeout = NGX_CONF_UNSET_MSEC;
|
2004-09-17 12:07:35 -04:00
|
|
|
lcf->keepalive_header = NGX_CONF_UNSET;
|
2004-03-16 03:10:12 -04:00
|
|
|
lcf->lingering_time = NGX_CONF_UNSET_MSEC;
|
|
|
|
lcf->lingering_timeout = NGX_CONF_UNSET_MSEC;
|
2004-06-06 15:49:18 -04:00
|
|
|
lcf->reset_timedout_connection = NGX_CONF_UNSET;
|
2005-06-07 11:56:31 -04:00
|
|
|
lcf->port_in_redirect = NGX_CONF_UNSET;
|
2003-10-24 03:53:41 -03:00
|
|
|
lcf->msie_padding = NGX_CONF_UNSET;
|
2006-08-28 12:57:48 -04:00
|
|
|
lcf->msie_refresh = NGX_CONF_UNSET;
|
2005-07-08 10:34:20 -04:00
|
|
|
lcf->log_not_found = NGX_CONF_UNSET;
|
2006-08-28 12:57:48 -04:00
|
|
|
lcf->recursive_error_pages = NGX_CONF_UNSET;
|
2005-12-16 12:07:08 -03:00
|
|
|
lcf->types_hash_max_size = NGX_CONF_UNSET_UINT;
|
|
|
|
lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT;
|
2003-10-24 03:53:41 -03:00
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
return lcf;
|
|
|
|
}
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
static ngx_str_t ngx_http_core_text_html_type = ngx_string("text/html");
|
|
|
|
static ngx_str_t ngx_http_core_image_gif_type = ngx_string("image/gif");
|
|
|
|
static ngx_str_t ngx_http_core_image_jpeg_type = ngx_string("image/jpeg");
|
|
|
|
|
|
|
|
static ngx_hash_key_t ngx_http_core_default_types[] = {
|
|
|
|
{ ngx_string("html"), 0, &ngx_http_core_text_html_type },
|
|
|
|
{ ngx_string("gif"), 0, &ngx_http_core_image_gif_type },
|
|
|
|
{ ngx_string("jpg"), 0, &ngx_http_core_image_jpeg_type },
|
|
|
|
{ ngx_null_string, 0, NULL }
|
2003-05-14 13:13:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
2005-12-16 12:07:08 -03:00
|
|
|
ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
2003-04-08 11:40:10 -04:00
|
|
|
{
|
2003-05-30 10:27:59 -04:00
|
|
|
ngx_http_core_loc_conf_t *prev = parent;
|
|
|
|
ngx_http_core_loc_conf_t *conf = child;
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_uint_t i;
|
2005-12-16 12:07:08 -03:00
|
|
|
ngx_hash_key_t *type;
|
|
|
|
ngx_hash_init_t types_hash;
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2006-01-24 13:08:27 -03:00
|
|
|
if (conf->root.data == NULL) {
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2006-03-21 04:20:41 -04:00
|
|
|
conf->alias = prev->alias;
|
2006-01-24 13:08:27 -03:00
|
|
|
conf->root = prev->root;
|
|
|
|
conf->root_lengths = prev->root_lengths;
|
|
|
|
conf->root_values = prev->root_values;
|
|
|
|
|
|
|
|
if (prev->root.data == NULL) {
|
|
|
|
conf->root.len = sizeof("html") - 1;
|
|
|
|
conf->root.data = (u_char *) "html";
|
|
|
|
|
|
|
|
if (ngx_conf_full_name(cf->cycle, &conf->root) == NGX_ERROR) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
2004-09-27 12:03:21 -04:00
|
|
|
}
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
if (conf->post_action.data == NULL) {
|
|
|
|
conf->post_action = prev->post_action;
|
|
|
|
}
|
|
|
|
|
2006-07-07 12:33:19 -04:00
|
|
|
ngx_conf_merge_uint_value(conf->types_hash_max_size,
|
|
|
|
prev->types_hash_max_size, 1024);
|
2005-12-16 12:07:08 -03:00
|
|
|
|
2006-07-07 12:33:19 -04:00
|
|
|
ngx_conf_merge_uint_value(conf->types_hash_bucket_size,
|
|
|
|
prev->types_hash_bucket_size,
|
|
|
|
ngx_cacheline_size);
|
2005-12-16 12:07:08 -03:00
|
|
|
|
|
|
|
conf->types_hash_bucket_size = ngx_align(conf->types_hash_bucket_size,
|
|
|
|
ngx_cacheline_size);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* the special handling the "types" directive in the "http" section
|
|
|
|
* to inherit the http's conf->types_hash to all servers
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (prev->types && prev->types_hash.buckets == NULL) {
|
|
|
|
|
|
|
|
types_hash.hash = &prev->types_hash;
|
|
|
|
types_hash.key = ngx_hash_key_lc;
|
|
|
|
types_hash.max_size = conf->types_hash_max_size;
|
|
|
|
types_hash.bucket_size = conf->types_hash_bucket_size;
|
2005-12-28 11:23:52 -03:00
|
|
|
types_hash.name = "types_hash";
|
2005-12-16 12:07:08 -03:00
|
|
|
types_hash.pool = cf->pool;
|
|
|
|
types_hash.temp_pool = NULL;
|
|
|
|
|
|
|
|
if (ngx_hash_init(&types_hash, prev->types->elts, prev->types->nelts)
|
|
|
|
!= NGX_OK)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-05-14 13:13:13 -04:00
|
|
|
if (conf->types == NULL) {
|
2005-12-16 12:07:08 -03:00
|
|
|
conf->types = prev->types;
|
|
|
|
conf->types_hash = prev->types_hash;
|
|
|
|
}
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
if (conf->types == NULL) {
|
|
|
|
conf->types = ngx_array_create(cf->pool, 4, sizeof(ngx_hash_key_t));
|
|
|
|
if (conf->types == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; ngx_http_core_default_types[i].key.len; i++) {
|
|
|
|
type = ngx_array_push(conf->types);
|
|
|
|
if (type == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
type->key = ngx_http_core_default_types[i].key;
|
|
|
|
type->key_hash =
|
|
|
|
ngx_hash_key_lc(ngx_http_core_default_types[i].key.data,
|
|
|
|
ngx_http_core_default_types[i].key.len);
|
|
|
|
type->value = ngx_http_core_default_types[i].value;
|
|
|
|
}
|
|
|
|
}
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
if (conf->types_hash.buckets == NULL) {
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
types_hash.hash = &conf->types_hash;
|
|
|
|
types_hash.key = ngx_hash_key_lc;
|
|
|
|
types_hash.max_size = conf->types_hash_max_size;
|
|
|
|
types_hash.bucket_size = conf->types_hash_bucket_size;
|
2005-12-28 11:23:52 -03:00
|
|
|
types_hash.name = "mime_types_hash";
|
2005-12-16 12:07:08 -03:00
|
|
|
types_hash.pool = cf->pool;
|
|
|
|
types_hash.temp_pool = NULL;
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2005-12-16 12:07:08 -03:00
|
|
|
if (ngx_hash_init(&types_hash, conf->types->elts, conf->types->nelts)
|
|
|
|
!= NGX_OK)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
2003-05-14 13:13:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-20 17:15:59 -04:00
|
|
|
if (conf->err_log == NULL) {
|
|
|
|
if (prev->err_log) {
|
|
|
|
conf->err_log = prev->err_log;
|
|
|
|
} else {
|
2004-04-16 01:14:16 -04:00
|
|
|
conf->err_log = cf->cycle->new_log;
|
2003-07-20 17:15:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-09 17:03:38 -03:00
|
|
|
if (conf->error_pages == NULL && prev->error_pages) {
|
|
|
|
conf->error_pages = prev->error_pages;
|
|
|
|
}
|
|
|
|
|
2003-05-27 08:18:54 -04:00
|
|
|
ngx_conf_merge_str_value(conf->default_type,
|
2005-02-09 11:31:07 -03:00
|
|
|
prev->default_type, "text/plain");
|
2003-05-27 08:18:54 -04:00
|
|
|
|
2006-07-07 12:33:19 -04:00
|
|
|
ngx_conf_merge_off_value(conf->client_max_body_size,
|
2004-10-01 11:53:53 -04:00
|
|
|
prev->client_max_body_size, 1 * 1024 * 1024);
|
2004-04-01 12:20:53 -04:00
|
|
|
ngx_conf_merge_size_value(conf->client_body_buffer_size,
|
2004-10-01 11:53:53 -04:00
|
|
|
prev->client_body_buffer_size,
|
|
|
|
(size_t) 2 * ngx_pagesize);
|
2003-10-27 18:01:00 -03:00
|
|
|
ngx_conf_merge_msec_value(conf->client_body_timeout,
|
2004-02-09 04:46:43 -03:00
|
|
|
prev->client_body_timeout, 60000);
|
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 10:58:06 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
ngx_conf_merge_value(conf->satisfy_any, prev->satisfy_any, 0);
|
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 10:58:06 -04:00
|
|
|
ngx_conf_merge_value(conf->internal, prev->internal, 0);
|
2006-04-14 05:53:38 -04:00
|
|
|
ngx_conf_merge_value(conf->client_body_in_file_only,
|
|
|
|
prev->client_body_in_file_only, 0);
|
2003-10-22 04:05:29 -03:00
|
|
|
ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
|
2007-05-07 02:33:39 -04:00
|
|
|
ngx_conf_merge_size_value(conf->sendfile_max_chunk,
|
|
|
|
prev->sendfile_max_chunk, 0);
|
2004-01-05 17:55:48 -03:00
|
|
|
ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
|
2006-08-28 12:57:48 -04:00
|
|
|
ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1);
|
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 10:58:06 -04:00
|
|
|
|
2004-02-09 04:46:43 -03:00
|
|
|
ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000);
|
2003-10-29 05:30:44 -03:00
|
|
|
ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0);
|
2004-07-14 12:01:42 -04:00
|
|
|
ngx_conf_merge_size_value(conf->postpone_output, prev->postpone_output,
|
|
|
|
1460);
|
|
|
|
ngx_conf_merge_size_value(conf->limit_rate, prev->limit_rate, 0);
|
2003-05-23 07:53:01 -04:00
|
|
|
ngx_conf_merge_msec_value(conf->keepalive_timeout,
|
2004-09-17 12:07:35 -04:00
|
|
|
prev->keepalive_timeout, 75000);
|
|
|
|
ngx_conf_merge_sec_value(conf->keepalive_header,
|
|
|
|
prev->keepalive_header, 0);
|
2003-05-23 07:53:01 -04:00
|
|
|
ngx_conf_merge_msec_value(conf->lingering_time,
|
|
|
|
prev->lingering_time, 30000);
|
|
|
|
ngx_conf_merge_msec_value(conf->lingering_timeout,
|
|
|
|
prev->lingering_timeout, 5000);
|
2003-05-14 13:13:13 -04: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 10:03:58 -03:00
|
|
|
ngx_conf_merge_path_value(conf->client_body_temp_path,
|
|
|
|
prev->client_body_temp_path,
|
|
|
|
NGX_HTTP_CLIENT_TEMP_PATH, 0, 0, 0,
|
|
|
|
ngx_garbage_collector_temp_handler, cf);
|
|
|
|
|
2004-06-06 15:49:18 -04:00
|
|
|
ngx_conf_merge_value(conf->reset_timedout_connection,
|
2005-02-09 11:31:07 -03:00
|
|
|
prev->reset_timedout_connection, 0);
|
2005-06-07 11:56:31 -04:00
|
|
|
ngx_conf_merge_value(conf->port_in_redirect, prev->port_in_redirect, 1);
|
2003-10-24 03:53:41 -03:00
|
|
|
ngx_conf_merge_value(conf->msie_padding, prev->msie_padding, 1);
|
2006-08-28 12:57:48 -04:00
|
|
|
ngx_conf_merge_value(conf->msie_refresh, prev->msie_refresh, 0);
|
2005-07-08 10:34:20 -04:00
|
|
|
ngx_conf_merge_value(conf->log_not_found, prev->log_not_found, 1);
|
2006-08-28 12:57:48 -04:00
|
|
|
ngx_conf_merge_value(conf->recursive_error_pages,
|
|
|
|
prev->recursive_error_pages, 0);
|
2003-10-24 03:53:41 -03:00
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
if (conf->open_files == NULL) {
|
|
|
|
conf->open_files = prev->open_files;
|
|
|
|
}
|
|
|
|
|
2003-04-08 11:40:10 -04:00
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
/* AF_INET only */
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2003-01-28 12:56:37 -03:00
|
|
|
{
|
2003-05-30 10:27:59 -04:00
|
|
|
ngx_http_core_srv_conf_t *scf = conf;
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2006-10-24 10:06:55 -03:00
|
|
|
ngx_str_t *value, size;
|
|
|
|
ngx_url_t u;
|
|
|
|
ngx_uint_t n;
|
|
|
|
ngx_http_listen_t *ls;
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2004-09-14 11:55:24 -04:00
|
|
|
/*
|
|
|
|
* TODO: check duplicate 'listen' directives,
|
|
|
|
* add resolved name to server names ???
|
|
|
|
*/
|
2003-05-15 11:42:53 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
value = cf->args->elts;
|
2005-11-15 10:30:52 -03:00
|
|
|
|
2006-10-24 10:06:55 -03:00
|
|
|
ngx_memzero(&u, sizeof(ngx_url_t));
|
2005-06-15 14:33:41 -04:00
|
|
|
|
2006-10-24 10:06:55 -03:00
|
|
|
u.url = value[1];
|
|
|
|
u.listen = 1;
|
2006-12-12 13:46:16 -03:00
|
|
|
u.default_port = 80;
|
2005-06-15 14:33:41 -04:00
|
|
|
|
2006-10-24 10:06:55 -03:00
|
|
|
if (ngx_parse_url(cf, &u) != NGX_OK) {
|
|
|
|
if (u.err) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"%s in \"%V\" of the \"listen\" directive",
|
|
|
|
u.err, &u.url);
|
|
|
|
}
|
2005-06-15 14:33:41 -04:00
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
return NGX_CONF_ERROR;
|
2005-06-15 14:33:41 -04:00
|
|
|
}
|
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
ls = ngx_array_push(&scf->listen);
|
|
|
|
if (ls == NULL) {
|
2004-09-14 11:55:24 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
ngx_memzero(ls, sizeof(ngx_http_listen_t));
|
2003-01-28 12:56:37 -03:00
|
|
|
|
|
|
|
ls->family = AF_INET;
|
2006-10-24 10:06:55 -03:00
|
|
|
ls->addr = u.addr.in_addr;
|
2006-12-12 13:46:16 -03:00
|
|
|
ls->port = u.port;
|
2003-01-29 04:25:51 -03:00
|
|
|
ls->file_name = cf->conf_file->file.name;
|
2003-01-28 12:56:37 -03:00
|
|
|
ls->line = cf->conf_file->line;
|
2005-06-15 14:33:41 -04:00
|
|
|
ls->conf.backlog = -1;
|
2005-10-19 09:33:58 -03:00
|
|
|
ls->conf.rcvbuf = -1;
|
|
|
|
ls->conf.sndbuf = -1;
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2006-04-07 10:08:04 -04:00
|
|
|
n = ngx_inet_ntop(AF_INET, &ls->addr, ls->conf.addr, INET_ADDRSTRLEN + 6);
|
|
|
|
ngx_sprintf(&ls->conf.addr[n], ":%ui", ls->port);
|
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
if (cf->args->nelts == 2) {
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
if (ngx_strcmp(value[2].data, "default") == 0) {
|
|
|
|
ls->conf.default_server = 1;
|
|
|
|
n = 3;
|
2005-12-16 12:07:08 -03:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
} else {
|
|
|
|
n = 2;
|
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
for ( /* void */ ; n < cf->args->nelts; n++) {
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
if (ls->conf.default_server == 0) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"\"%V\" parameter can be specified for "
|
|
|
|
"the default \"listen\" directive only",
|
|
|
|
&value[n]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-07-18 10:44:05 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
if (ngx_strcmp(value[n].data, "bind") == 0) {
|
|
|
|
ls->conf.bind = 1;
|
|
|
|
continue;
|
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-10-19 09:33:58 -03:00
|
|
|
if (ngx_strncmp(value[n].data, "backlog=", 8) == 0) {
|
|
|
|
ls->conf.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8);
|
2005-06-15 14:33:41 -04:00
|
|
|
ls->conf.bind = 1;
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
if (ls->conf.backlog == NGX_ERROR || ls->conf.backlog == 0) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"invalid backlog \"%V\"", &value[n]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2004-09-21 15:55:00 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
continue;
|
|
|
|
}
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2005-10-19 09:33:58 -03:00
|
|
|
if (ngx_strncmp(value[n].data, "rcvbuf=", 7) == 0) {
|
|
|
|
size.len = value[n].len - 7;
|
|
|
|
size.data = value[n].data + 7;
|
|
|
|
|
|
|
|
ls->conf.rcvbuf = ngx_parse_size(&size);
|
|
|
|
ls->conf.bind = 1;
|
|
|
|
|
|
|
|
if (ls->conf.rcvbuf == NGX_ERROR) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"invalid rcvbuf \"%V\"", &value[n]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_strncmp(value[n].data, "sndbuf=", 7) == 0) {
|
|
|
|
size.len = value[n].len - 7;
|
|
|
|
size.data = value[n].data + 7;
|
|
|
|
|
|
|
|
ls->conf.sndbuf = ngx_parse_size(&size);
|
|
|
|
ls->conf.bind = 1;
|
|
|
|
|
|
|
|
if (ls->conf.sndbuf == NGX_ERROR) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"invalid sndbuf \"%V\"", &value[n]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_strncmp(value[n].data, "accept_filter=", 14) == 0) {
|
2005-06-15 14:33:41 -04:00
|
|
|
#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
|
2005-10-19 09:33:58 -03:00
|
|
|
ls->conf.accept_filter = (char *) &value[n].data[14];
|
2005-06-15 14:33:41 -04:00
|
|
|
ls->conf.bind = 1;
|
|
|
|
#else
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"accept filters \"%V\" are not supported "
|
|
|
|
"on this platform, ignored",
|
|
|
|
&value[n]);
|
|
|
|
#endif
|
|
|
|
continue;
|
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
if (ngx_strcmp(value[n].data, "deferred") == 0) {
|
|
|
|
#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
|
|
|
|
ls->conf.deferred_accept = 1;
|
|
|
|
ls->conf.bind = 1;
|
|
|
|
#else
|
2003-07-18 10:44:05 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2005-06-15 14:33:41 -04:00
|
|
|
"the deferred accept is not supported "
|
|
|
|
"on this platform, ignored");
|
|
|
|
#endif
|
|
|
|
continue;
|
2003-05-29 09:02:09 -04:00
|
|
|
}
|
|
|
|
|
2005-06-15 14:33:41 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"the invalid \"%V\" parameter", &value[n]);
|
|
|
|
return NGX_CONF_ERROR;
|
2003-05-29 09:02:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2003-05-29 09:02:09 -04:00
|
|
|
{
|
2005-12-26 14:07:48 -03:00
|
|
|
ngx_http_core_srv_conf_t *cscf = conf;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
u_char ch;
|
|
|
|
ngx_str_t *value, name;
|
|
|
|
ngx_uint_t i;
|
|
|
|
ngx_http_server_name_t *sn;
|
2004-06-25 10:42:03 -04:00
|
|
|
|
2003-05-30 10:27:59 -04:00
|
|
|
value = cf->args->elts;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
ch = value[1].data[0];
|
|
|
|
|
|
|
|
if (cscf->server_name.data == NULL && value[1].len) {
|
|
|
|
if (ch == '*') {
|
2003-07-18 10:44:05 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2005-12-26 14:07:48 -03:00
|
|
|
"first server name \"%V\" must not be wildcard",
|
|
|
|
&value[1]);
|
2003-07-18 10:44:05 -04:00
|
|
|
return NGX_CONF_ERROR;
|
2003-05-30 10:27:59 -04:00
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
name = value[1];
|
|
|
|
|
|
|
|
if (ch == '.') {
|
|
|
|
name.len--;
|
|
|
|
name.data++;
|
|
|
|
}
|
|
|
|
|
|
|
|
cscf->server_name.len = name.len;
|
|
|
|
cscf->server_name.data = ngx_pstrdup(cf->pool, &name);
|
|
|
|
if (cscf->server_name.data == NULL) {
|
2004-10-21 12:34:38 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2005-12-26 14:07:48 -03:00
|
|
|
}
|
2003-05-30 10:27:59 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
for (i = 1; i < cf->args->nelts; i++) {
|
2004-06-25 10:42:03 -04:00
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
ch = value[i].data[0];
|
2004-10-21 12:34:38 -03:00
|
|
|
|
2006-07-07 12:33:19 -04:00
|
|
|
if (value[i].len == 1 && ch == '*') {
|
|
|
|
cscf->wildcard = 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
if (value[i].len == 0
|
|
|
|
|| (ch == '*' && (value[i].len < 3 || value[i].data[1] != '.'))
|
|
|
|
|| (ch == '.' && value[i].len < 2))
|
|
|
|
{
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"server name \"%V\" is invalid", &value[i]);
|
|
|
|
return NGX_CONF_ERROR;
|
2004-10-21 12:34:38 -03:00
|
|
|
}
|
|
|
|
|
2007-04-02 02:27:30 -04:00
|
|
|
if (ngx_strchr(value[i].data, '/')) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
|
|
"server name \"%V\" has strange symbols",
|
|
|
|
&value[i]);
|
|
|
|
}
|
|
|
|
|
2005-12-26 14:07:48 -03:00
|
|
|
sn = ngx_array_push(&cscf->server_names);
|
|
|
|
if (sn == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
2004-06-25 10:42:03 -04:00
|
|
|
}
|
2005-12-26 14:07:48 -03:00
|
|
|
|
|
|
|
sn->name.len = value[i].len;
|
|
|
|
sn->name.data = value[i].data;
|
|
|
|
sn->core_srv_conf = cscf;
|
2003-05-30 10:27:59 -04:00
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2003-01-28 12:56:37 -03:00
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
2003-07-07 02:11:50 -04:00
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2004-03-16 03:10:12 -04:00
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *lcf = conf;
|
|
|
|
|
2005-12-28 11:23:52 -03:00
|
|
|
ngx_str_t *value;
|
|
|
|
ngx_uint_t alias, n;
|
|
|
|
ngx_http_script_compile_t sc;
|
2004-03-16 03:10:12 -04:00
|
|
|
|
|
|
|
alias = (cmd->name.len == sizeof("alias") - 1) ? 1 : 0;
|
|
|
|
|
|
|
|
if (lcf->root.data) {
|
2004-03-30 16:31:58 -04:00
|
|
|
|
|
|
|
/* the (ngx_uint_t) cast is required by gcc 2.7.2.3 */
|
|
|
|
|
|
|
|
if ((ngx_uint_t) lcf->alias == alias) {
|
2004-03-16 03:10:12 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"\"%V\" directive is duplicate",
|
|
|
|
&cmd->name);
|
2004-03-16 03:10:12 -04:00
|
|
|
} else {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"\"%V\" directive is duplicate, "
|
2004-03-16 03:10:12 -04:00
|
|
|
"\"%s\" directive is specified before",
|
2004-11-11 11:07:14 -03:00
|
|
|
&cmd->name, lcf->alias ? "alias" : "root");
|
2004-03-16 03:10:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
value = cf->args->elts;
|
|
|
|
|
2007-04-02 01:43:21 -04:00
|
|
|
if (ngx_strstr(value[1].data, "$document_root")
|
|
|
|
|| ngx_strstr(value[1].data, "${document_root}"))
|
2007-04-01 05:03:14 -04:00
|
|
|
{
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"the $document_root variable may not be used "
|
|
|
|
"in the \"%V\" directive",
|
|
|
|
&cmd->name);
|
|
|
|
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
lcf->alias = alias;
|
|
|
|
lcf->root = value[1];
|
|
|
|
|
2004-08-30 15:24:51 -04:00
|
|
|
if (!alias && lcf->root.data[lcf->root.len - 1] == '/') {
|
|
|
|
lcf->root.len--;
|
|
|
|
}
|
|
|
|
|
2006-07-28 11:16:17 -04:00
|
|
|
if (lcf->root.data[0] != '$') {
|
|
|
|
if (ngx_conf_full_name(cf->cycle, &lcf->root) == NGX_ERROR) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2006-01-24 13:08:27 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
n = ngx_http_script_variables_count(&lcf->root);
|
2005-12-28 11:23:52 -03:00
|
|
|
|
|
|
|
if (n == 0) {
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
|
|
|
|
|
|
|
|
sc.cf = cf;
|
2006-01-24 13:08:27 -03:00
|
|
|
sc.source = &lcf->root;
|
2005-12-28 11:23:52 -03:00
|
|
|
sc.lengths = &lcf->root_lengths;
|
|
|
|
sc.values = &lcf->root_values;
|
|
|
|
sc.variables = n;
|
|
|
|
sc.complete_lengths = 1;
|
|
|
|
sc.complete_values = 1;
|
|
|
|
|
|
|
|
if (ngx_http_script_compile(&sc) != NGX_OK) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-04-07 10:08:04 -04:00
|
|
|
static ngx_http_method_name_t ngx_methods_names[] = {
|
2007-02-14 15:51:19 -03:00
|
|
|
{ (u_char *) "GET", (uint32_t) ~NGX_HTTP_GET },
|
|
|
|
{ (u_char *) "HEAD", (uint32_t) ~NGX_HTTP_HEAD },
|
|
|
|
{ (u_char *) "POST", (uint32_t) ~NGX_HTTP_POST },
|
|
|
|
{ (u_char *) "PUT", (uint32_t) ~NGX_HTTP_PUT },
|
|
|
|
{ (u_char *) "DELETE", (uint32_t) ~NGX_HTTP_DELETE },
|
|
|
|
{ (u_char *) "MKCOL", (uint32_t) ~NGX_HTTP_MKCOL },
|
|
|
|
{ (u_char *) "COPY", (uint32_t) ~NGX_HTTP_COPY },
|
|
|
|
{ (u_char *) "MOVE", (uint32_t) ~NGX_HTTP_MOVE },
|
|
|
|
{ (u_char *) "OPTIONS", (uint32_t) ~NGX_HTTP_OPTIONS },
|
|
|
|
{ (u_char *) "PROPFIND" , (uint32_t) ~NGX_HTTP_PROPFIND },
|
|
|
|
{ (u_char *) "PROPPATCH", (uint32_t) ~NGX_HTTP_PROPPATCH },
|
|
|
|
{ (u_char *) "LOCK", (uint32_t) ~NGX_HTTP_LOCK },
|
|
|
|
{ (u_char *) "UNLOCK", (uint32_t) ~NGX_HTTP_UNLOCK },
|
2006-04-07 10:08:04 -04:00
|
|
|
{ NULL, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *clcf = conf;
|
|
|
|
|
|
|
|
char *rv;
|
|
|
|
void *mconf;
|
|
|
|
ngx_str_t *value;
|
|
|
|
ngx_uint_t i;
|
|
|
|
ngx_conf_t save;
|
|
|
|
ngx_http_module_t *module;
|
|
|
|
ngx_http_conf_ctx_t *ctx, *pctx;
|
|
|
|
ngx_http_method_name_t *name;
|
|
|
|
ngx_http_core_loc_conf_t *lcf, **clcfp;
|
|
|
|
|
|
|
|
if (clcf->limit_except) {
|
|
|
|
return "duplicate";
|
|
|
|
}
|
|
|
|
|
|
|
|
clcf->limit_except = 0xffffffff;
|
|
|
|
|
|
|
|
value = cf->args->elts;
|
|
|
|
|
|
|
|
for (i = 1; i < cf->args->nelts; i++) {
|
|
|
|
for (name = ngx_methods_names; name->name; name++) {
|
|
|
|
|
|
|
|
if (ngx_strcasecmp(value[i].data, name->name) == 0) {
|
|
|
|
clcf->limit_except &= name->method;
|
|
|
|
goto next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"invalid method \"%V\"", &value[i]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
|
|
|
|
next:
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(clcf->limit_except & NGX_HTTP_GET)) {
|
|
|
|
clcf->limit_except &= (uint32_t) ~NGX_HTTP_HEAD;
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
|
|
|
|
if (ctx == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
pctx = cf->ctx;
|
|
|
|
ctx->main_conf = pctx->main_conf;
|
|
|
|
ctx->srv_conf = pctx->srv_conf;
|
|
|
|
|
|
|
|
ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (ctx->loc_conf == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; ngx_modules[i]; i++) {
|
|
|
|
if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
module = ngx_modules[i]->ctx;
|
|
|
|
|
|
|
|
if (module->create_loc_conf) {
|
|
|
|
|
|
|
|
mconf = module->create_loc_conf(cf);
|
|
|
|
if (mconf == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lcf = ctx->loc_conf[ngx_http_core_module.ctx_index];
|
|
|
|
clcf->limit_except_loc_conf = ctx->loc_conf;
|
|
|
|
lcf->loc_conf = ctx->loc_conf;
|
|
|
|
lcf->name = clcf->name;
|
|
|
|
lcf->noname = 1;
|
|
|
|
|
|
|
|
if (clcf->locations.elts == NULL) {
|
|
|
|
if (ngx_array_init(&clcf->locations, cf->pool, 4, sizeof(void *))
|
|
|
|
== NGX_ERROR)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
clcfp = ngx_array_push(&clcf->locations);
|
|
|
|
if (clcfp == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
*clcfp = lcf;
|
|
|
|
|
|
|
|
|
|
|
|
save = *cf;
|
|
|
|
cf->ctx = ctx;
|
|
|
|
cf->cmd_type = NGX_HTTP_LMT_CONF;
|
|
|
|
|
|
|
|
rv = ngx_conf_parse(cf, NULL);
|
|
|
|
|
|
|
|
*cf = save;
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2003-11-09 17:03:38 -03:00
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *lcf = conf;
|
|
|
|
|
2006-08-14 11:09:38 -04:00
|
|
|
ngx_int_t overwrite;
|
|
|
|
ngx_str_t *value, uri;
|
|
|
|
ngx_uint_t i, n, nvar;
|
|
|
|
ngx_array_t *uri_lengths, *uri_values;
|
|
|
|
ngx_http_err_page_t *err;
|
|
|
|
ngx_http_script_compile_t sc;
|
2003-11-09 17:03:38 -03:00
|
|
|
|
|
|
|
if (lcf->error_pages == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
lcf->error_pages = ngx_array_create(cf->pool, 4,
|
2003-11-09 17:03:38 -03:00
|
|
|
sizeof(ngx_http_err_page_t));
|
|
|
|
if (lcf->error_pages == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
value = cf->args->elts;
|
|
|
|
|
2004-04-21 14:54:33 -04:00
|
|
|
i = cf->args->nelts - 2;
|
|
|
|
|
|
|
|
if (value[i].data[0] == '=') {
|
|
|
|
if (i == 1) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"invalid value \"%V\"", &value[i]);
|
2004-04-21 14:54:33 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-10-05 10:46:21 -04:00
|
|
|
if (value[i].len > 1) {
|
|
|
|
overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1);
|
2004-04-21 14:54:33 -04:00
|
|
|
|
2005-10-05 10:46:21 -04:00
|
|
|
if (overwrite == NGX_ERROR) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"invalid value \"%V\"", &value[i]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
overwrite = 0;
|
2004-04-21 14:54:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
n = 2;
|
|
|
|
|
|
|
|
} else {
|
2005-10-05 10:46:21 -04:00
|
|
|
overwrite = -1;
|
2004-04-21 14:54:33 -04:00
|
|
|
n = 1;
|
|
|
|
}
|
|
|
|
|
2006-08-14 11:09:38 -04:00
|
|
|
uri = value[cf->args->nelts - 1];
|
|
|
|
uri_lengths = NULL;
|
|
|
|
uri_values = NULL;
|
|
|
|
|
|
|
|
nvar = ngx_http_script_variables_count(&uri);
|
|
|
|
|
|
|
|
if (nvar) {
|
|
|
|
ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
|
|
|
|
|
|
|
|
sc.cf = cf;
|
|
|
|
sc.source = &uri;
|
|
|
|
sc.lengths = &uri_lengths;
|
|
|
|
sc.values = &uri_values;
|
|
|
|
sc.variables = nvar;
|
|
|
|
sc.complete_lengths = 1;
|
|
|
|
sc.complete_values = 1;
|
|
|
|
|
|
|
|
if (ngx_http_script_compile(&sc) != NGX_OK) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-04-21 14:54:33 -04:00
|
|
|
for (i = 1; i < cf->args->nelts - n; i++) {
|
2005-03-19 08:38:37 -04:00
|
|
|
err = ngx_array_push(lcf->error_pages);
|
|
|
|
if (err == NULL) {
|
2004-04-21 14:54:33 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-04-25 16:13:21 -04:00
|
|
|
err->status = ngx_atoi(value[i].data, value[i].len);
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2006-09-25 13:48:34 -04:00
|
|
|
if (err->status == NGX_ERROR || err->status == 499) {
|
2003-11-09 17:03:38 -03:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"invalid value \"%V\"", &value[i]);
|
2003-11-09 17:03:38 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-04-25 16:13:21 -04:00
|
|
|
if (err->status < 400 || err->status > 599) {
|
2003-11-09 17:03:38 -03:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"value \"%V\" must be between 400 and 599",
|
|
|
|
&value[i]);
|
2003-11-09 17:03:38 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-10-05 10:46:21 -04:00
|
|
|
err->overwrite = (overwrite >= 0) ? overwrite : err->status;
|
|
|
|
|
2006-08-14 11:09:38 -04:00
|
|
|
err->uri = uri;
|
|
|
|
err->uri_lengths = uri_lengths;
|
|
|
|
err->uri_values = uri_values;
|
2003-11-09 17:03:38 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_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 10:58:06 -04:00
|
|
|
static char *
|
|
|
|
ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *lcf = conf;
|
|
|
|
|
|
|
|
lcf->err_log = ngx_log_create_errlog(cf->cycle, cf->args);
|
|
|
|
if (lcf->err_log == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ngx_set_error_log_levels(cf, lcf->err_log);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2004-09-17 12:07:35 -04:00
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *lcf = conf;
|
|
|
|
|
|
|
|
ngx_str_t *value;
|
|
|
|
|
|
|
|
if (lcf->keepalive_timeout != NGX_CONF_UNSET_MSEC) {
|
|
|
|
return "is duplicate";
|
|
|
|
}
|
|
|
|
|
|
|
|
value = cf->args->elts;
|
|
|
|
|
|
|
|
lcf->keepalive_timeout = ngx_parse_time(&value[1], 0);
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2004-09-17 12:07:35 -04:00
|
|
|
if (lcf->keepalive_timeout == (ngx_msec_t) NGX_ERROR) {
|
|
|
|
return "invalid value";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lcf->keepalive_timeout == (ngx_msec_t) NGX_PARSE_LARGE_TIME) {
|
|
|
|
return "value must be less than 597 hours";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cf->args->nelts == 2) {
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
lcf->keepalive_header = ngx_parse_time(&value[2], 1);
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2004-09-17 12:07:35 -04:00
|
|
|
if (lcf->keepalive_header == NGX_ERROR) {
|
|
|
|
return "invalid value";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lcf->keepalive_header == NGX_PARSE_LARGE_TIME) {
|
|
|
|
return "value must be less than 68 years";
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
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 10:58:06 -04:00
|
|
|
ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2003-07-07 02:11:50 -04:00
|
|
|
{
|
|
|
|
ngx_http_core_loc_conf_t *lcf = 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 10:58:06 -04:00
|
|
|
if (lcf->internal != NGX_CONF_UNSET) {
|
|
|
|
return "is duplicate";
|
2004-01-20 17:40:08 -03:00
|
|
|
}
|
2003-07-07 02:11:50 -04: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 10:58:06 -04:00
|
|
|
lcf->internal = 1;
|
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
2003-07-07 02:11:50 -04:00
|
|
|
}
|
2003-10-29 05:30:44 -03:00
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data)
|
2003-10-29 05:30:44 -03:00
|
|
|
{
|
2004-10-21 12:34:38 -03:00
|
|
|
#if (NGX_FREEBSD)
|
2004-12-02 15:40:46 -03:00
|
|
|
ssize_t *np = data;
|
2004-10-11 12:07:03 -03:00
|
|
|
|
2006-08-14 11:09:38 -04:00
|
|
|
if ((u_long) *np >= ngx_freebsd_net_inet_tcp_sendspace) {
|
2003-10-29 05:30:44 -03:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"\"send_lowat\" must be less than %d "
|
|
|
|
"(sysctl net.inet.tcp.sendspace)",
|
|
|
|
ngx_freebsd_net_inet_tcp_sendspace);
|
|
|
|
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-11-25 13:17:31 -03:00
|
|
|
#elif !(NGX_HAVE_SO_SNDLOWAT)
|
2004-12-02 15:40:46 -03:00
|
|
|
ssize_t *np = data;
|
2003-10-29 05:30:44 -03:00
|
|
|
|
|
|
|
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
|
|
"\"send_lowat\" is not supported, ignored");
|
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
*np = 0;
|
|
|
|
|
2003-10-29 05:30:44 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
2007-05-07 05:20:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data)
|
|
|
|
{
|
|
|
|
size_t *sp = data;
|
|
|
|
|
|
|
|
if (*sp < NGX_MIN_POOL_SIZE) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"pool must be no less than %uz", NGX_MIN_POOL_SIZE);
|
|
|
|
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|