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
|
|
|
|
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
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
static void ngx_http_core_run_phases(ngx_http_request_t *r);
|
|
|
|
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);
|
|
|
|
static ngx_int_t ngx_http_core_postconfiguration(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);
|
|
|
|
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);
|
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 =
|
|
|
|
{ ngx_http_core_lowat_check };
|
2003-10-29 05:30:44 -03:00
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2004-05-14 12:51:47 -04:00
|
|
|
static ngx_conf_enum_t ngx_http_restrict_host_names[] = {
|
|
|
|
{ ngx_string("off"), NGX_HTTP_RESTRICT_HOST_OFF },
|
|
|
|
{ ngx_string("on"), NGX_HTTP_RESTRICT_HOST_ON },
|
|
|
|
{ ngx_string("close"), NGX_HTTP_RESTRICT_HOST_CLOSE },
|
|
|
|
{ ngx_null_string, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-01-09 02:36:00 -03:00
|
|
|
static ngx_command_t ngx_http_core_commands[] = {
|
|
|
|
|
2004-12-21 09:30:30 -03:00
|
|
|
{ ngx_string("server_names_hash"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_main_conf_t, server_names_hash),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("server_names_hash_threshold"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_num_slot,
|
|
|
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_main_conf_t, server_names_hash_threshold),
|
|
|
|
NULL },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("server"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|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),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("post_accept_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, post_accept_timeout),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ 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),
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ 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 },
|
|
|
|
|
2004-05-14 12:51:47 -04:00
|
|
|
{ ngx_string("restrict_host_names"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
|
|
|
ngx_conf_set_enum_slot,
|
|
|
|
NGX_HTTP_SRV_CONF_OFFSET,
|
|
|
|
offsetof(ngx_http_core_srv_conf_t, restrict_host_names),
|
|
|
|
&ngx_http_restrict_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"),
|
2003-06-02 11:24:30 -04:00
|
|
|
#if 0
|
2003-11-30 17:03:18 -03:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
2003-06-02 11:24:30 -04:00
|
|
|
#else
|
2004-10-21 12:34:38 -03:00
|
|
|
NGX_HTTP_SRV_CONF|NGX_CONF_TAKE12,
|
2003-06-02 11:24:30 -04:00
|
|
|
#endif
|
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 },
|
|
|
|
|
|
|
|
{ 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 },
|
|
|
|
|
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,
|
|
|
|
ngx_conf_set_size_slot,
|
|
|
|
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 },
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
{ ngx_string("sendfile"),
|
|
|
|
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, sendfile),
|
|
|
|
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 },
|
|
|
|
|
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 },
|
|
|
|
|
|
|
|
{ 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 },
|
|
|
|
|
|
|
|
{ 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
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
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 */
|
|
|
|
ngx_http_core_postconfiguration, /* 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 */
|
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 */
|
2004-07-16 13:11:43 -04:00
|
|
|
NULL /* init process */
|
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
|
|
|
{
|
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;
|
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
switch (r->headers_in.connection_type) {
|
|
|
|
case 0:
|
|
|
|
if (r->http_version > NGX_HTTP_VERSION_10) {
|
|
|
|
r->keepalive = 1;
|
|
|
|
} else {
|
2003-10-21 04:47:21 -03:00
|
|
|
r->keepalive = 0;
|
|
|
|
}
|
2003-10-21 13:49:56 -03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case NGX_HTTP_CONNECTION_CLOSE:
|
|
|
|
r->keepalive = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NGX_HTTP_CONNECTION_KEEP_ALIVE:
|
|
|
|
r->keepalive = 1;
|
|
|
|
break;
|
2003-10-21 04:47:21 -03:00
|
|
|
}
|
|
|
|
|
2004-07-30 13:05:14 -04:00
|
|
|
if (r->keepalive && r->headers_in.msie && r->method == NGX_HTTP_POST) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* MSIE may wait for some time if the response for the POST request
|
|
|
|
* is sent over the keepalive connection
|
|
|
|
*/
|
|
|
|
|
|
|
|
r->keepalive = 0;
|
|
|
|
}
|
|
|
|
|
2003-10-27 05:53:49 -03:00
|
|
|
#if 0
|
2003-10-22 13:38:26 -03:00
|
|
|
/* TEST STUB */ r->http_version = NGX_HTTP_VERSION_10;
|
2003-10-21 04:47:21 -03:00
|
|
|
/* TEST STUB */ r->keepalive = 0;
|
|
|
|
#endif
|
2003-05-15 11:42:53 -04:00
|
|
|
|
|
|
|
if (r->headers_in.content_length_n > 0) {
|
|
|
|
r->lingering_close = 1;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
|
|
|
} else {
|
|
|
|
r->lingering_close = 0;
|
2003-05-15 11:42:53 -04:00
|
|
|
}
|
|
|
|
|
2003-10-21 04:47:21 -03:00
|
|
|
#if 0
|
2003-05-15 11:42:53 -04:00
|
|
|
/* TEST STUB */ r->lingering_close = 1;
|
2003-10-21 04:47:21 -03:00
|
|
|
#endif
|
2003-05-15 11:42:53 -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
|
|
|
r->write_event_handler = ngx_http_core_run_phases;
|
2003-10-10 11:10:50 -04:00
|
|
|
|
2005-03-28 10:43:02 -04:00
|
|
|
r->valid_unparsed_uri = 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
|
|
|
r->valid_location = 1;
|
2005-02-03 16:33:37 -03:00
|
|
|
r->uri_changed = 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
|
|
|
r->uri_changes = NGX_HTTP_MAX_REWRITE_CYCLES + 1;
|
2005-03-28 10:43:02 -04:00
|
|
|
|
2005-02-16 10:40:36 -03:00
|
|
|
r->phase = NGX_HTTP_REWRITE_PHASE;
|
|
|
|
r->phase_handler = 0;
|
2005-02-03 16:33:37 -03:00
|
|
|
|
|
|
|
ngx_http_core_run_phases(r);
|
2003-10-10 11:10:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static void
|
|
|
|
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;
|
2003-10-10 11:10:50 -04:00
|
|
|
ngx_http_handler_pt *h;
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
2003-10-10 11:10:50 -04:00
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
|
|
|
|
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_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http phase handler");
|
|
|
|
|
2003-10-10 11:10:50 -04:00
|
|
|
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
for (/* void */; r->phase < NGX_HTTP_LAST_PHASE; r->phase++) {
|
|
|
|
|
2005-02-16 10:40:36 -03:00
|
|
|
if (r->phase == NGX_HTTP_REWRITE_PHASE + 1 && r->uri_changed) {
|
2005-02-03 16:33:37 -03:00
|
|
|
|
|
|
|
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 cycle");
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-02-16 10:40:36 -03:00
|
|
|
r->phase = NGX_HTTP_FIND_CONFIG_PHASE;
|
2005-02-03 16:33:37 -03:00
|
|
|
}
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
if (r->phase == NGX_HTTP_CONTENT_PHASE && r->content_handler) {
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
r->write_event_handler = ngx_http_request_empty_handler;
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_finalize_request(r, r->content_handler(r));
|
2003-11-30 17:03:18 -03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-10-10 11:10:50 -04:00
|
|
|
h = cmcf->phases[r->phase].handlers.elts;
|
|
|
|
for (r->phase_handler = cmcf->phases[r->phase].handlers.nelts - 1;
|
|
|
|
r->phase_handler >= 0;
|
|
|
|
r->phase_handler--)
|
|
|
|
{
|
|
|
|
rc = h[r->phase_handler](r);
|
|
|
|
|
2003-10-21 04:47:21 -03:00
|
|
|
if (rc == NGX_DONE) {
|
2003-11-30 17:03:18 -03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* we should never use r here because
|
|
|
|
* it could point to already freed data
|
|
|
|
*/
|
|
|
|
|
2003-10-21 04:47:21 -03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-10-10 11:10:50 -04:00
|
|
|
if (rc == NGX_DECLINED) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2005-05-14 14:42:03 -04:00
|
|
|
if (rc >= NGX_HTTP_SPECIAL_RESPONSE
|
|
|
|
|| rc == NGX_HTTP_NO_CONTENT
|
|
|
|
|| rc == NGX_ERROR)
|
|
|
|
{
|
2003-12-15 10:57:13 -03:00
|
|
|
ngx_http_finalize_request(r, rc);
|
2003-10-10 11:10:50 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-12-15 10:57:13 -03:00
|
|
|
if (r->phase == NGX_HTTP_CONTENT_PHASE) {
|
2003-10-10 11:10:50 -04:00
|
|
|
ngx_http_finalize_request(r, rc);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-12-15 10:57:13 -03:00
|
|
|
if (rc == NGX_AGAIN) {
|
2003-11-30 17:03:18 -03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-10-10 11:10:50 -04:00
|
|
|
if (rc == NGX_OK && cmcf->phases[r->phase].type == NGX_OK) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-11-30 17:03:18 -03:00
|
|
|
}
|
2003-10-10 11:10:50 -04:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
/* no content handler was found */
|
2003-05-15 11:42:53 -04:00
|
|
|
|
2005-02-16 10:40:36 -03:00
|
|
|
if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) {
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
2003-04-08 11:40:10 -04:00
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
2005-02-03 16:33:37 -03:00
|
|
|
"directory index of \"%V%V\" is forbidden",
|
|
|
|
&clcf->root, &r->uri);
|
2003-11-30 17:03:18 -03:00
|
|
|
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_FORBIDDEN);
|
2003-10-10 11:10:50 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no handler found");
|
|
|
|
|
|
|
|
ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
|
2003-10-10 11:10:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_find_location_config(ngx_http_request_t *r)
|
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) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
|
|
|
return NGX_HTTP_NOT_FOUND;
|
|
|
|
}
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
r->connection->log->file = clcf->err_log->file;
|
|
|
|
if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
|
|
|
|
r->connection->log->log_level = clcf->err_log->log_level;
|
|
|
|
}
|
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) {
|
|
|
|
r->connection->sendfile = 1;
|
2004-07-18 15:11:20 -04:00
|
|
|
|
|
|
|
} else {
|
2004-10-11 12:07:03 -03:00
|
|
|
r->connection->sendfile = 0;
|
2004-07-18 15:11:20 -04:00
|
|
|
}
|
|
|
|
|
2005-01-25 09:27:35 -03:00
|
|
|
if (r->keepalive && clcf->keepalive_timeout == 0) {
|
|
|
|
r->keepalive = 0;
|
|
|
|
}
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
if (!clcf->tcp_nopush) {
|
|
|
|
/* disable TCP_NOPUSH/TCP_CORK use */
|
|
|
|
r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"http cl:%z max:%uz",
|
|
|
|
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
|
|
|
|
&& clcf->client_max_body_size
|
|
|
|
&& clcf->client_max_body_size < (size_t) r->headers_in.content_length_n)
|
|
|
|
{
|
|
|
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"client intented to send too large body: %z bytes",
|
2004-07-18 15:11:20 -04:00
|
|
|
r->headers_in.content_length_n);
|
|
|
|
|
|
|
|
return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
|
|
|
|
}
|
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) {
|
2004-07-18 15:11:20 -04:00
|
|
|
return NGX_HTTP_INTERNAL_SERVER_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
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
|
|
|
|
return NGX_HTTP_MOVED_PERMANENTLY;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clcf->handler) {
|
|
|
|
r->content_handler = clcf->handler;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "find location");
|
|
|
|
|
|
|
|
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,
|
2004-07-18 15:11:20 -04: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;
|
2003-11-30 17:03:18 -03:00
|
|
|
uint32_t key;
|
2004-03-16 03:10:12 -04:00
|
|
|
ngx_uint_t i;
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_http_type_t *type;
|
|
|
|
ngx_http_core_loc_conf_t *clcf;
|
|
|
|
|
|
|
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
|
|
|
|
|
|
if (r->exten.len) {
|
2005-02-03 16:33:37 -03:00
|
|
|
|
|
|
|
if (!r->low_case_exten) {
|
|
|
|
for (i = 0; i < r->exten.len; i++) {
|
|
|
|
c = r->exten.data[i];
|
|
|
|
if (c >= 'A' && c <= 'Z') {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i < r->exten.len) {
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
exten = p;
|
|
|
|
|
|
|
|
for (i = 0; i < r->exten.len; i++) {
|
|
|
|
c = r->exten.data[i];
|
|
|
|
if (c >= 'A' && c <= 'Z') {
|
|
|
|
*p++ = (u_char) (c | 0x20);
|
|
|
|
} else {
|
|
|
|
*p++ = c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
r->exten.data = exten;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->low_case_exten = 1;
|
|
|
|
}
|
|
|
|
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_http_types_hash_key(key, r->exten);
|
|
|
|
|
|
|
|
type = clcf->types[key].elts;
|
|
|
|
for (i = 0; i < clcf->types[key].nelts; i++) {
|
|
|
|
if (r->exten.len != type[i].exten.len) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_memcmp(r->exten.data, type[i].exten.data, r->exten.len)
|
|
|
|
== 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
|
|
|
r->headers_out.content_type = type[i].type;
|
2003-11-30 17:03:18 -03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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->headers_out.content_type.len == 0) {
|
|
|
|
r->headers_out.content_type= clcf->default_type;
|
2003-11-30 17:03:18 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
{
|
2003-11-11 15:13:43 -03:00
|
|
|
if (r->err_ctx) {
|
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;
|
|
|
|
|
|
|
|
if (r->connection->write->error) {
|
|
|
|
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
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http output filter \"%V\"", &r->uri);
|
|
|
|
|
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 */
|
2004-05-12 01:37:55 -04:00
|
|
|
r->connection->write->error = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_redirect(ngx_http_request_t *r, int redirect)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
|
|
|
/* STUB */
|
|
|
|
|
|
|
|
/* log request */
|
|
|
|
|
2003-05-13 12:02:32 -04:00
|
|
|
ngx_http_close_request(r, 0);
|
|
|
|
return NGX_OK;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_set_exten(ngx_http_request_t *r)
|
2003-01-09 02:36:00 -03:00
|
|
|
{
|
2003-12-25 17:26:58 -03:00
|
|
|
ngx_int_t i;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
|
|
|
r->exten.len = 0;
|
|
|
|
r->exten.data = NULL;
|
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
for (i = r->uri.len - 1; i > 1; i--) {
|
|
|
|
if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
|
|
|
|
r->exten.len = r->uri.len - i - 1;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
|
|
|
if (r->exten.len > 0) {
|
2005-03-19 08:38:37 -04:00
|
|
|
r->exten.data = ngx_palloc(r->pool, r->exten.len + 1);
|
|
|
|
if (r->exten.data == NULL) {
|
2003-12-25 17:26:58 -03:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
ngx_cpystrn(r->exten.data, &r->uri.data[i + 1],
|
|
|
|
r->exten.len + 1);
|
2003-05-29 09:02:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
} else if (r->uri.data[i] == '/') {
|
2003-05-29 09:02:09 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-01-09 02:36:00 -03:00
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
r->low_case_exten = 0;
|
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_subrequest(ngx_http_request_t *r,
|
|
|
|
ngx_str_t *uri, ngx_str_t *args)
|
|
|
|
{
|
|
|
|
ngx_http_request_t *sr;
|
|
|
|
ngx_http_core_srv_conf_t *cscf;
|
|
|
|
ngx_http_postponed_request_t *pr, *p;
|
|
|
|
|
|
|
|
sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t));
|
|
|
|
if (sr == NULL) {
|
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
sr->signature = NGX_HTTP_MODULE;
|
|
|
|
sr->connection = r->connection;
|
|
|
|
|
|
|
|
sr->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (sr->ctx == NULL) {
|
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_list_init(&sr->headers_out.headers, r->pool, 20,
|
|
|
|
sizeof(ngx_table_elt_t)) == NGX_ERROR)
|
|
|
|
{
|
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
sr->start_time = ngx_time();
|
|
|
|
sr->headers_out.content_length_n = -1;
|
|
|
|
sr->headers_out.last_modified_time = -1;
|
|
|
|
|
|
|
|
sr->request_body = r->request_body;
|
|
|
|
|
|
|
|
sr->method = NGX_HTTP_GET;
|
|
|
|
sr->http_version = r->http_version;
|
|
|
|
sr->http_major = r->http_minor;
|
|
|
|
|
|
|
|
sr->request_line = r->request_line;
|
|
|
|
sr->uri = *uri;
|
|
|
|
if (args) {
|
|
|
|
sr->args = *args;
|
|
|
|
}
|
|
|
|
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) {
|
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
sr->main = r->main ? r->main : r;
|
|
|
|
sr->parent = r;
|
|
|
|
sr->read_event_handler = ngx_http_request_empty_handler;
|
|
|
|
sr->write_event_handler = ngx_http_request_empty_handler;
|
|
|
|
|
|
|
|
if (r->connection->data == r) {
|
|
|
|
sr->connection->data = sr;
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
sr->internal = 1;
|
|
|
|
|
2005-05-16 09:53:20 -04:00
|
|
|
sr->main_filter_need_in_memory = r->main_filter_need_in_memory;
|
|
|
|
|
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_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http subrequest \"%V\"", uri);
|
|
|
|
|
|
|
|
ngx_http_handler(sr);
|
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http subrequest \"%V\" done", uri);
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2003-12-25 17:26:58 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"internal redirect: \"%V\"", uri);
|
2003-12-25 17:26:58 -03:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
if (ngx_http_set_exten(r) != NGX_OK) {
|
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
2003-11-11 15:13:43 -03:00
|
|
|
if (r->err_ctx) {
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
/* allocate the new module's contexts */
|
2003-11-10 18:09:22 -03:00
|
|
|
|
|
|
|
r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
|
|
|
|
if (r->ctx == NULL) {
|
|
|
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2003-11-11 15:13:43 -03:00
|
|
|
|
|
|
|
/* clear the modules contexts */
|
|
|
|
|
2003-11-10 18:09:22 -03:00
|
|
|
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;
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
#if 0 /* STUB: test the delay http handler */
|
2003-10-12 13:49:16 -03:00
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_delay_handler(ngx_http_request_t *r)
|
2003-10-12 13:49:16 -03:00
|
|
|
{
|
|
|
|
static int on;
|
|
|
|
|
|
|
|
if (on++ == 0) {
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http set delay");
|
2003-10-12 13:49:16 -03:00
|
|
|
ngx_add_timer(r->connection->write, 10000);
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->connection->write->timedout = 0;
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http reset delay");
|
2003-10-12 13:49:16 -03:00
|
|
|
return NGX_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
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
|
|
|
{
|
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
|
|
|
|
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
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
uint32_t key;
|
|
|
|
ngx_uint_t i;
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_str_t *value;
|
2003-11-30 17:03:18 -03:00
|
|
|
ngx_http_type_t *type;
|
2003-05-14 13:13:13 -04:00
|
|
|
|
|
|
|
if (lcf->types == NULL) {
|
2004-09-14 15:39:54 -04:00
|
|
|
lcf->types = ngx_palloc(cf->pool, NGX_HTTP_TYPES_HASH_PRIME
|
|
|
|
* sizeof(ngx_array_t));
|
|
|
|
if (lcf->types == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-14 13:13:13 -04:00
|
|
|
|
|
|
|
for (i = 0; i < NGX_HTTP_TYPES_HASH_PRIME; i++) {
|
2005-03-04 11:06:57 -03:00
|
|
|
if (ngx_array_init(&lcf->types[i], cf->pool, 4,
|
2004-09-14 15:39:54 -04:00
|
|
|
sizeof(ngx_http_type_t)) == NGX_ERROR)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-14 13:13:13 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
value = cf->args->elts;
|
2003-05-14 13:13:13 -04:00
|
|
|
|
|
|
|
for (i = 1; i < cf->args->nelts; i++) {
|
2005-02-03 16:33:37 -03:00
|
|
|
ngx_http_types_hash_key(key, value[i]);
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
type = ngx_array_push(&lcf->types[key]);
|
|
|
|
if (type == NULL) {
|
2004-09-14 15:39:54 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-02-03 16:33:37 -03:00
|
|
|
type->exten = value[i];
|
|
|
|
type->type = value[0];
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static ngx_int_t
|
|
|
|
ngx_http_core_postconfiguration(ngx_conf_t *cf)
|
|
|
|
{
|
|
|
|
return ngx_http_variables_init_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-02-03 16:33:37 -03:00
|
|
|
sizeof(ngx_http_core_srv_conf_t *)) == NGX_ERROR)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-19 12:39:14 -04:00
|
|
|
|
2004-12-21 09:30:30 -03:00
|
|
|
cmcf->server_names_hash = NGX_CONF_UNSET_UINT;
|
|
|
|
cmcf->server_names_hash_threshold = 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
|
|
|
|
2004-12-21 09:30:30 -03:00
|
|
|
if (cmcf->server_names_hash == NGX_CONF_UNSET_UINT) {
|
|
|
|
cmcf->server_names_hash = 1009;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmcf->server_names_hash_threshold == NGX_CONF_UNSET_UINT) {
|
|
|
|
cmcf->server_names_hash_threshold = 50;
|
|
|
|
}
|
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-02-09 11:31:07 -03:00
|
|
|
== NGX_ERROR)
|
|
|
|
{
|
|
|
|
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-02-09 11:31:07 -03:00
|
|
|
== NGX_ERROR)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-03-04 11:06:57 -03:00
|
|
|
if (ngx_array_init(&cscf->server_names, cf->pool, 4,
|
2005-02-09 11:31:07 -03:00
|
|
|
sizeof(ngx_http_server_name_t)) == NGX_ERROR)
|
|
|
|
{
|
|
|
|
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->post_accept_timeout = NGX_CONF_UNSET_MSEC;
|
|
|
|
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;
|
2004-05-14 12:51:47 -04:00
|
|
|
cscf->restrict_host_names = NGX_CONF_UNSET_UINT;
|
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-02-09 11:31:07 -03:00
|
|
|
ngx_http_listen_t *ls;
|
|
|
|
ngx_http_server_name_t *sn;
|
2004-06-25 10:42:03 -04:00
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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-06-07 11:56:31 -04:00
|
|
|
ls->default_server = 0;
|
2003-01-09 02:36:00 -03:00
|
|
|
}
|
|
|
|
|
2003-05-19 12:39:14 -04:00
|
|
|
if (conf->server_names.nelts == 0) {
|
2005-03-19 08:38:37 -04:00
|
|
|
sn = ngx_array_push(&conf->server_names);
|
|
|
|
if (sn == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
sn->name.data = ngx_palloc(cf->pool, NGX_MAXHOSTNAMELEN);
|
|
|
|
if (sn->name.data == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gethostname((char *) sn->name.data, NGX_MAXHOSTNAMELEN) == -1) {
|
2003-07-18 10:44:05 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
|
|
|
|
"gethostname() failed");
|
|
|
|
return NGX_CONF_ERROR;
|
2003-01-15 04:02:27 -03:00
|
|
|
}
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
sn->name.len = ngx_strlen(sn->name.data);
|
|
|
|
sn->core_srv_conf = conf;
|
|
|
|
sn->wildcard = 0;
|
2004-06-25 10:42:03 -04:00
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
|
2004-06-25 10:42:03 -04:00
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
if (cmcf->max_server_name_len < sn->name.len) {
|
|
|
|
cmcf->max_server_name_len = sn->name.len;
|
2004-06-25 10:42:03 -04:00
|
|
|
}
|
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-06-11 11:28:34 -04:00
|
|
|
ngx_conf_merge_msec_value(conf->post_accept_timeout,
|
2004-10-01 11:53:53 -04:00
|
|
|
prev->post_accept_timeout, 60000);
|
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;
|
|
|
|
}
|
|
|
|
|
2004-05-14 12:51:47 -04:00
|
|
|
ngx_conf_merge_unsigned_value(conf->restrict_host_names,
|
2005-02-09 11:31:07 -03:00
|
|
|
prev->restrict_host_names, 0);
|
2003-05-23 07:53:01 -04: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():
|
|
|
|
*
|
|
|
|
* lcf->root.len = 0;
|
|
|
|
* lcf->root.data = NULL;
|
|
|
|
* lcf->types = NULL;
|
|
|
|
* lcf->default_type.len = 0;
|
|
|
|
* lcf->default_type.data = NULL;
|
|
|
|
* 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
|
|
|
|
2004-03-19 01:25:53 -04:00
|
|
|
lcf->client_max_body_size = NGX_CONF_UNSET_SIZE;
|
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;
|
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;
|
2003-10-22 04:05:29 -03:00
|
|
|
lcf->sendfile = NGX_CONF_UNSET;
|
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;
|
|
|
|
|
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-02-09 11:31:07 -03:00
|
|
|
static ngx_http_type_t ngx_http_core_default_types[] = {
|
2003-05-14 13:13:13 -04:00
|
|
|
{ ngx_string("html"), ngx_string("text/html") },
|
|
|
|
{ ngx_string("gif"), ngx_string("image/gif") },
|
|
|
|
{ ngx_string("jpg"), ngx_string("image/jpeg") },
|
|
|
|
{ ngx_null_string, ngx_null_string }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
static char *
|
|
|
|
ngx_http_core_merge_loc_conf(ngx_conf_t *cf,
|
2003-04-08 11:40:10 -04:00
|
|
|
void *parent, void *child)
|
|
|
|
{
|
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
|
|
|
uint32_t key;
|
|
|
|
ngx_uint_t i;
|
|
|
|
ngx_http_type_t *type;
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
ngx_conf_merge_str_value(conf->root, prev->root, "html");
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2004-09-27 12:03:21 -04:00
|
|
|
if (ngx_conf_full_name(cf->cycle, &conf->root) == NGX_ERROR) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2003-05-14 13:13:13 -04:00
|
|
|
if (conf->types == NULL) {
|
|
|
|
if (prev->types) {
|
|
|
|
conf->types = prev->types;
|
|
|
|
|
|
|
|
} else {
|
2005-02-09 11:31:07 -03:00
|
|
|
conf->types = ngx_palloc(cf->pool, NGX_HTTP_TYPES_HASH_PRIME
|
|
|
|
* sizeof(ngx_array_t));
|
|
|
|
if (conf->types == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-14 13:13:13 -04:00
|
|
|
|
|
|
|
for (i = 0; i < NGX_HTTP_TYPES_HASH_PRIME; i++) {
|
2005-03-04 11:06:57 -03:00
|
|
|
if (ngx_array_init(&conf->types[i], cf->pool, 4,
|
2005-02-09 11:31:07 -03:00
|
|
|
sizeof(ngx_http_type_t)) == NGX_ERROR)
|
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-14 13:13:13 -04:00
|
|
|
}
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
for (i = 0; ngx_http_core_default_types[i].exten.len; i++) {
|
|
|
|
ngx_http_types_hash_key(key,
|
|
|
|
ngx_http_core_default_types[i].exten);
|
2003-05-14 13:13:13 -04:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
type = ngx_array_push(&conf->types[key]);
|
|
|
|
if (type == NULL) {
|
2005-02-09 11:31:07 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
*type = ngx_http_core_default_types[i];
|
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
|
|
|
|
2004-03-19 01:25:53 -04:00
|
|
|
ngx_conf_merge_size_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
|
|
|
|
|
|
|
ngx_conf_merge_value(conf->internal, prev->internal, 0);
|
2003-10-22 04:05:29 -03:00
|
|
|
ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
|
2004-01-05 17:55:48 -03:00
|
|
|
ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
|
2004-10-11 12:07:03 -03:00
|
|
|
ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 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
|
|
|
|
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);
|
|
|
|
|
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-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
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
u_char *addr;
|
2004-09-07 11:29:22 -04:00
|
|
|
ngx_int_t port;
|
|
|
|
ngx_uint_t p;
|
2003-01-28 12:56:37 -03:00
|
|
|
ngx_str_t *args;
|
2005-06-07 11:56:31 -04:00
|
|
|
struct hostent *h;
|
2003-01-28 12:56:37 -03:00
|
|
|
ngx_http_listen_t *ls;
|
|
|
|
|
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-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
|
|
|
|
|
|
|
/* AF_INET only */
|
|
|
|
|
|
|
|
ls->family = AF_INET;
|
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-07 11:56:31 -04:00
|
|
|
ls->default_server = 0;
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2003-05-29 09:02:09 -04:00
|
|
|
args = cf->args->elts;
|
2003-05-15 11:42:53 -04:00
|
|
|
addr = args[1].data;
|
|
|
|
|
|
|
|
for (p = 0; p < args[1].len; p++) {
|
|
|
|
if (addr[p] == ':') {
|
|
|
|
addr[p++] = '\0';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p == args[1].len) {
|
2003-05-29 09:02:09 -04:00
|
|
|
/* no ":" in the "listen" */
|
2003-05-15 11:42:53 -04:00
|
|
|
p = 0;
|
|
|
|
}
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2004-09-07 11:29:22 -04:00
|
|
|
port = ngx_atoi(&addr[p], args[1].len - p);
|
2004-09-23 12:39:34 -04:00
|
|
|
|
2004-09-07 11:29:22 -04:00
|
|
|
if (port == NGX_ERROR && p == 0) {
|
2003-05-29 09:02:09 -04:00
|
|
|
|
|
|
|
/* "listen host" */
|
|
|
|
ls->port = 80;
|
|
|
|
|
2004-09-07 11:29:22 -04:00
|
|
|
} else if ((port == NGX_ERROR && p != 0) /* "listen host:NONNUMBER" */
|
|
|
|
|| (port < 1 || port > 65536)) { /* "listen 99999" */
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2003-07-18 10:44:05 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"invalid port \"%s\" in \"%V\" directive, "
|
2003-07-18 10:44:05 -04:00
|
|
|
"it must be a number between 1 and 65535",
|
2004-11-11 11:07:14 -03:00
|
|
|
&addr[p], &cmd->name);
|
2003-07-18 10:44:05 -04:00
|
|
|
|
|
|
|
return NGX_CONF_ERROR;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
|
|
|
} else if (p == 0) {
|
|
|
|
ls->addr = INADDR_ANY;
|
2004-09-07 11:29:22 -04:00
|
|
|
ls->port = (in_port_t) port;
|
2003-05-29 09:02:09 -04:00
|
|
|
return NGX_CONF_OK;
|
2003-01-28 12:56:37 -03:00
|
|
|
|
2004-09-23 12:39:34 -04:00
|
|
|
} else {
|
|
|
|
ls->port = (in_port_t) port;
|
|
|
|
}
|
2004-09-21 15:55:00 -04:00
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
ls->addr = inet_addr((const char *) addr);
|
2005-02-09 11:31:07 -03:00
|
|
|
|
2003-05-29 09:02:09 -04:00
|
|
|
if (ls->addr == INADDR_NONE) {
|
2004-03-16 03:10:12 -04:00
|
|
|
h = gethostbyname((const char *) addr);
|
2003-05-29 09:02:09 -04:00
|
|
|
|
|
|
|
if (h == NULL || h->h_addr_list[0] == NULL) {
|
2003-07-18 10:44:05 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"can not resolve host \"%s\" "
|
2004-11-11 11:07:14 -03:00
|
|
|
"in \"%V\" directive", addr, &cmd->name);
|
2003-07-18 10:44:05 -04:00
|
|
|
return NGX_CONF_ERROR;
|
2003-05-29 09:02:09 -04:00
|
|
|
}
|
|
|
|
|
2003-11-25 17:44:56 -03:00
|
|
|
ls->addr = *(in_addr_t *)(h->h_addr_list[0]);
|
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
|
|
|
{
|
2003-05-30 10:27:59 -04:00
|
|
|
ngx_http_core_srv_conf_t *scf = conf;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
2004-06-25 10:42:03 -04:00
|
|
|
ngx_uint_t i;
|
|
|
|
ngx_str_t *value;
|
|
|
|
ngx_http_server_name_t *sn;
|
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
2003-05-29 09:02:09 -04:00
|
|
|
|
|
|
|
/* TODO: warn about duplicate 'server_name' directives */
|
|
|
|
|
2004-07-18 15:11:20 -04:00
|
|
|
cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
|
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
|
|
|
|
2003-05-30 10:27:59 -04:00
|
|
|
for (i = 1; i < cf->args->nelts; i++) {
|
|
|
|
if (value[i].len == 0) {
|
2003-07-18 10:44:05 -04:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"server name \"%V\" is invalid "
|
|
|
|
"in \"%V\" directive",
|
|
|
|
&value[i], &cmd->name);
|
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-03-19 08:38:37 -04:00
|
|
|
sn = ngx_array_push(&scf->server_names);
|
|
|
|
if (sn == NULL) {
|
2004-10-21 12:34:38 -03:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-05-30 10:27:59 -04:00
|
|
|
|
|
|
|
sn->name.len = value[i].len;
|
|
|
|
sn->name.data = value[i].data;
|
|
|
|
sn->core_srv_conf = scf;
|
2004-06-25 10:42:03 -04:00
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
if (sn->name.data[0] == '*') {
|
|
|
|
sn->name.len--;
|
|
|
|
sn->name.data++;
|
|
|
|
sn->wildcard = 1;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
sn->wildcard = 0;
|
|
|
|
}
|
|
|
|
|
2004-06-25 10:42:03 -04:00
|
|
|
if (cmcf->max_server_name_len < sn->name.len) {
|
|
|
|
cmcf->max_server_name_len = sn->name.len;
|
|
|
|
}
|
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;
|
|
|
|
|
|
|
|
ngx_uint_t alias;
|
|
|
|
ngx_str_t *value;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
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--;
|
|
|
|
}
|
|
|
|
|
2004-03-16 03:10:12 -04:00
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2005-02-09 11:31:07 -03:00
|
|
|
ngx_int_t overwrite;
|
2004-04-21 14:54:33 -04:00
|
|
|
ngx_uint_t i, n;
|
2003-11-09 17:03:38 -03:00
|
|
|
ngx_str_t *value;
|
|
|
|
ngx_http_err_page_t *err;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1);
|
|
|
|
|
|
|
|
if (overwrite == NGX_ERROR) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
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
|
|
|
"invalid value \"%V\"", &value[i]);
|
2004-04-21 14:54:33 -04:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
n = 2;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
overwrite = 0;
|
|
|
|
n = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
2004-04-25 16:13:21 -04:00
|
|
|
if (err->status == NGX_ERROR) {
|
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;
|
|
|
|
}
|
|
|
|
|
2004-04-21 14:54:33 -04:00
|
|
|
err->overwrite = overwrite;
|
2003-11-09 17:03:38 -03:00
|
|
|
err->uri = value[cf->args->nelts - 1];
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
2003-10-29 05:30:44 -03:00
|
|
|
if (*np >= ngx_freebsd_net_inet_tcp_sendspace) {
|
|
|
|
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;
|
|
|
|
}
|