2003-11-10 04:03:38 +08:00
|
|
|
|
2004-09-28 16:34:51 +08:00
|
|
|
/*
|
2004-09-30 00:00:49 +08:00
|
|
|
* Copyright (C) Igor Sysoev
|
2004-09-28 16:34:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
|
|
|
#include <ngx_http.h>
|
|
|
|
#include <nginx.h>
|
|
|
|
|
|
|
|
|
2006-11-27 22:46:15 +08:00
|
|
|
typedef struct ngx_http_log_op_s ngx_http_log_op_t;
|
|
|
|
|
|
|
|
typedef u_char *(*ngx_http_log_op_run_pt) (ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op);
|
|
|
|
|
|
|
|
typedef size_t (*ngx_http_log_op_getlen_pt) (ngx_http_request_t *r,
|
|
|
|
uintptr_t data);
|
|
|
|
|
|
|
|
|
|
|
|
struct ngx_http_log_op_s {
|
|
|
|
size_t len;
|
|
|
|
ngx_http_log_op_getlen_pt getlen;
|
|
|
|
ngx_http_log_op_run_pt run;
|
|
|
|
uintptr_t data;
|
|
|
|
};
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ngx_str_t name;
|
|
|
|
ngx_array_t *ops; /* array of ngx_http_log_op_t */
|
|
|
|
} ngx_http_log_fmt_t;
|
|
|
|
|
2006-06-29 00:00:26 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
typedef struct {
|
|
|
|
ngx_array_t formats; /* array of ngx_http_log_fmt_t */
|
|
|
|
ngx_uint_t combined_used; /* unsigned combined_used:1 */
|
|
|
|
} ngx_http_log_main_conf_t;
|
|
|
|
|
2006-06-29 00:00:26 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
typedef struct {
|
|
|
|
ngx_open_file_t *file;
|
2006-04-14 17:53:38 +08:00
|
|
|
time_t disk_full_time;
|
2007-01-22 03:01:01 +08:00
|
|
|
time_t error_log_time;
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_array_t *ops; /* array of ngx_http_log_op_t */
|
|
|
|
} ngx_http_log_t;
|
|
|
|
|
2006-06-29 00:00:26 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
typedef struct {
|
|
|
|
ngx_array_t *logs; /* array of ngx_http_log_t */
|
|
|
|
ngx_uint_t off; /* unsigned off:1 */
|
|
|
|
} ngx_http_log_loc_conf_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ngx_str_t name;
|
|
|
|
size_t len;
|
|
|
|
ngx_http_log_op_run_pt run;
|
|
|
|
} ngx_http_log_var_t;
|
|
|
|
|
|
|
|
|
2007-01-22 03:01:01 +08:00
|
|
|
static void ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log,
|
|
|
|
u_char *buf, size_t len);
|
|
|
|
|
2004-03-16 15:10:12 +08:00
|
|
|
static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op);
|
2004-03-16 15:10:12 +08:00
|
|
|
static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op);
|
2004-03-16 15:10:12 +08:00
|
|
|
static u_char *ngx_http_log_time(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op);
|
2004-08-29 11:55:41 +08:00
|
|
|
static u_char *ngx_http_log_msec(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op);
|
|
|
|
static u_char *ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op);
|
2004-03-16 15:10:12 +08:00
|
|
|
static u_char *ngx_http_log_status(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op);
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
static u_char *ngx_http_log_bytes_sent(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op);
|
2005-11-15 21:30:52 +08:00
|
|
|
static u_char *ngx_http_log_body_bytes_sent(ngx_http_request_t *r,
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
u_char *buf, ngx_http_log_op_t *op);
|
2004-12-06 22:45:08 +08:00
|
|
|
static u_char *ngx_http_log_request_length(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op);
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
static ngx_int_t ngx_http_log_variable_compile(ngx_conf_t *cf,
|
|
|
|
ngx_http_log_op_t *op, ngx_str_t *value);
|
|
|
|
static size_t ngx_http_log_variable_getlen(ngx_http_request_t *r,
|
|
|
|
uintptr_t data);
|
|
|
|
static u_char *ngx_http_log_variable(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op);
|
|
|
|
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
static void *ngx_http_log_create_main_conf(ngx_conf_t *cf);
|
|
|
|
static void *ngx_http_log_create_loc_conf(ngx_conf_t *cf);
|
|
|
|
static char *ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent,
|
2005-03-01 23:20:36 +08:00
|
|
|
void *child);
|
2003-11-10 04:03:38 +08:00
|
|
|
static char *ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-03-01 23:20:36 +08:00
|
|
|
void *conf);
|
2003-11-10 04:03:38 +08:00
|
|
|
static char *ngx_http_log_set_format(ngx_conf_t *cf, ngx_command_t *cmd,
|
2005-03-01 23:20:36 +08:00
|
|
|
void *conf);
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
static char *ngx_http_log_compile_format(ngx_conf_t *cf,
|
|
|
|
ngx_array_t *ops, ngx_array_t *args, ngx_uint_t s);
|
|
|
|
static ngx_int_t ngx_http_log_init(ngx_conf_t *cf);
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
static ngx_command_t ngx_http_log_commands[] = {
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
{ ngx_string("log_format"),
|
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_2MORE,
|
|
|
|
ngx_http_log_set_format,
|
|
|
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
{ ngx_string("access_log"),
|
2006-05-04 23:32:46 +08:00
|
|
|
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
|
|
|
|
|NGX_CONF_TAKE123,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_set_log,
|
|
|
|
NGX_HTTP_LOC_CONF_OFFSET,
|
|
|
|
0,
|
|
|
|
NULL },
|
|
|
|
|
|
|
|
ngx_null_command
|
2003-11-10 04:03:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-07-28 23:16:17 +08:00
|
|
|
static ngx_http_module_t ngx_http_log_module_ctx = {
|
2006-11-27 22:46:15 +08:00
|
|
|
NULL, /* preconfiguration */
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_http_log_init, /* postconfiguration */
|
2003-11-11 01:17:31 +08:00
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
ngx_http_log_create_main_conf, /* create main configuration */
|
|
|
|
NULL, /* init main configuration */
|
|
|
|
|
|
|
|
NULL, /* create server configuration */
|
|
|
|
NULL, /* merge server configuration */
|
|
|
|
|
|
|
|
ngx_http_log_create_loc_conf, /* create location configration */
|
|
|
|
ngx_http_log_merge_loc_conf /* merge location configration */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ngx_module_t ngx_http_log_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 22:58:06 +08:00
|
|
|
NGX_MODULE_V1,
|
2003-11-10 04:03:38 +08:00
|
|
|
&ngx_http_log_module_ctx, /* module context */
|
|
|
|
ngx_http_log_commands, /* module directives */
|
|
|
|
NGX_HTTP_MODULE, /* module type */
|
2005-09-08 22:36:09 +08:00
|
|
|
NULL, /* init master */
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
NULL, /* init module */
|
2005-09-08 22:36:09 +08:00
|
|
|
NULL, /* init process */
|
|
|
|
NULL, /* init thread */
|
|
|
|
NULL, /* exit thread */
|
|
|
|
NULL, /* exit process */
|
|
|
|
NULL, /* exit master */
|
|
|
|
NGX_MODULE_V1_PADDING
|
2003-11-10 04:03:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
static ngx_str_t ngx_http_access_log = ngx_string(NGX_HTTP_LOG_PATH);
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
static ngx_str_t ngx_http_combined_fmt =
|
2005-11-26 18:11:11 +08:00
|
|
|
ngx_string("$remote_addr - $remote_user [$time_local] "
|
2005-11-15 21:30:52 +08:00
|
|
|
"\"$request\" $status $body_bytes_sent "
|
2005-10-24 23:09:41 +08:00
|
|
|
"\"$http_referer\" \"$http_user_agent\"");
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
static ngx_http_log_var_t ngx_http_log_vars[] = {
|
|
|
|
{ ngx_string("connection"), NGX_ATOMIC_T_LEN, ngx_http_log_connection },
|
|
|
|
{ ngx_string("pipe"), 1, ngx_http_log_pipe },
|
2005-11-26 18:11:11 +08:00
|
|
|
{ ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1,
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_http_log_time },
|
|
|
|
{ ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec },
|
2007-04-21 15:50:19 +08:00
|
|
|
{ ngx_string("request_time"), NGX_TIME_T_LEN + 4,
|
|
|
|
ngx_http_log_request_time },
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
{ ngx_string("status"), 3, ngx_http_log_status },
|
|
|
|
{ ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent },
|
2005-11-15 21:30:52 +08:00
|
|
|
{ ngx_string("body_bytes_sent"), NGX_OFF_T_LEN,
|
|
|
|
ngx_http_log_body_bytes_sent },
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
{ ngx_string("apache_bytes_sent"), NGX_OFF_T_LEN,
|
2005-11-15 21:30:52 +08:00
|
|
|
ngx_http_log_body_bytes_sent },
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
{ ngx_string("request_length"), NGX_SIZE_T_LEN,
|
|
|
|
ngx_http_log_request_length },
|
|
|
|
|
|
|
|
{ ngx_null_string, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_int_t
|
|
|
|
ngx_http_log_handler(ngx_http_request_t *r)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
2004-03-16 15:10:12 +08:00
|
|
|
u_char *line, *p;
|
2003-11-10 04:03:38 +08:00
|
|
|
size_t len;
|
2007-01-22 03:01:01 +08:00
|
|
|
ngx_uint_t i, l;
|
2003-11-10 04:03:38 +08:00
|
|
|
ngx_http_log_t *log;
|
2005-10-27 23:46:13 +08:00
|
|
|
ngx_open_file_t *file;
|
2003-11-10 04:03:38 +08:00
|
|
|
ngx_http_log_op_t *op;
|
|
|
|
ngx_http_log_loc_conf_t *lcf;
|
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
|
"http log handler");
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
lcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
|
|
|
|
|
2004-09-16 00:00:43 +08:00
|
|
|
if (lcf->off) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
log = lcf->logs->elts;
|
|
|
|
for (l = 0; l < lcf->logs->nelts; l++) {
|
|
|
|
|
2006-04-14 17:53:38 +08:00
|
|
|
if (ngx_time() == log[l].disk_full_time) {
|
|
|
|
|
|
|
|
/*
|
2007-01-22 03:01:01 +08:00
|
|
|
* on FreeBSD writing to a full filesystem with enabled softupdates
|
2006-04-14 17:53:38 +08:00
|
|
|
* may block process for much longer time than writing to non-full
|
2007-01-22 03:01:01 +08:00
|
|
|
* filesystem, so we skip writing to a log for one second
|
2006-04-14 17:53:38 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
len = 0;
|
|
|
|
op = log[l].ops->elts;
|
|
|
|
for (i = 0; i < log[l].ops->nelts; i++) {
|
|
|
|
if (op[i].len == 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 21:03:58 +08:00
|
|
|
len += op[i].getlen(r, op[i].data);
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
} else {
|
|
|
|
len += op[i].len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-10-27 23:46:13 +08:00
|
|
|
len += NGX_LINEFEED_SIZE;
|
|
|
|
|
|
|
|
file = log[l].file;
|
|
|
|
|
|
|
|
if (file->buffer) {
|
|
|
|
|
|
|
|
if (len > (size_t) (file->last - file->pos)) {
|
|
|
|
|
2007-01-22 03:01:01 +08:00
|
|
|
ngx_http_log_write(r, &log[l], file->buffer,
|
|
|
|
file->pos - file->buffer);
|
2005-10-27 23:46:13 +08:00
|
|
|
|
|
|
|
file->pos = file->buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (len <= (size_t) (file->last - file->pos)) {
|
|
|
|
|
|
|
|
p = file->pos;
|
|
|
|
|
|
|
|
for (i = 0; i < log[l].ops->nelts; i++) {
|
|
|
|
p = op[i].run(r, p, &op[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_linefeed(p);
|
|
|
|
|
|
|
|
file->pos = p;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
line = ngx_palloc(r->pool, len);
|
|
|
|
if (line == NULL) {
|
2004-12-03 02:40:46 +08:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
p = line;
|
|
|
|
|
|
|
|
for (i = 0; i < log[l].ops->nelts; i++) {
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
p = op[i].run(r, p, &op[i]);
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
2005-10-27 23:46:13 +08:00
|
|
|
ngx_linefeed(p);
|
|
|
|
|
2007-01-22 03:01:01 +08:00
|
|
|
ngx_http_log_write(r, &log[l], line, p - line);
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-22 03:01:01 +08:00
|
|
|
static void
|
|
|
|
ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
|
|
|
|
size_t len)
|
|
|
|
{
|
|
|
|
time_t now;
|
|
|
|
ssize_t n;
|
|
|
|
ngx_err_t err;
|
|
|
|
|
|
|
|
n = ngx_write_fd(log->file->fd, buf, len);
|
|
|
|
|
|
|
|
if (n == (ssize_t) len) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
now = ngx_time();
|
|
|
|
|
|
|
|
if (n == -1) {
|
|
|
|
err = ngx_errno;
|
|
|
|
|
|
|
|
if (err == NGX_ENOSPC) {
|
|
|
|
log->disk_full_time = now;
|
|
|
|
}
|
|
|
|
|
2007-04-04 05:54:13 +08:00
|
|
|
if (now - log->error_log_time > 59) {
|
2007-01-22 03:01:01 +08:00
|
|
|
ngx_log_error(NGX_LOG_ALERT, r->connection->log, err,
|
|
|
|
ngx_write_fd_n " to \"%V\" failed",
|
|
|
|
&log->file->name);
|
|
|
|
|
|
|
|
log->error_log_time = now;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-04-04 05:54:13 +08:00
|
|
|
if (now - log->error_log_time > 59) {
|
2007-01-22 03:01:01 +08:00
|
|
|
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
|
|
|
|
ngx_write_fd_n " to \"%V\" was incomplete: %z of %uz",
|
|
|
|
&log->file->name, n, len);
|
|
|
|
|
|
|
|
log->error_log_time = now;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_copy_short(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op)
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
{
|
|
|
|
size_t len;
|
|
|
|
uintptr_t data;
|
|
|
|
|
|
|
|
len = op->len;
|
|
|
|
data = op->data;
|
|
|
|
|
|
|
|
while (len--) {
|
|
|
|
*buf++ = (u_char) (data & 0xff);
|
|
|
|
data >>= 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_copy_long(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op)
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 21:03:58 +08:00
|
|
|
{
|
|
|
|
return ngx_cpymem(buf, (u_char *) op->data, op->len);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_connection(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
2004-10-21 23:34:38 +08:00
|
|
|
return ngx_sprintf(buf, "%ui", r->connection->number);
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
|
|
|
if (r->pipeline) {
|
|
|
|
*buf = 'p';
|
|
|
|
} else {
|
|
|
|
*buf = '.';
|
|
|
|
}
|
|
|
|
|
|
|
|
return buf + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_time(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
2003-11-11 05:09:22 +08:00
|
|
|
return ngx_cpymem(buf, ngx_cached_http_log_time.data,
|
|
|
|
ngx_cached_http_log_time.len);
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_msec(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
|
2004-08-29 11:55:41 +08:00
|
|
|
{
|
2005-10-19 20:33:58 +08:00
|
|
|
ngx_time_t *tp;
|
2004-08-29 11:55:41 +08:00
|
|
|
|
2005-10-19 20:33:58 +08:00
|
|
|
tp = ngx_timeofday();
|
2004-08-29 11:55:41 +08:00
|
|
|
|
2005-10-19 20:33:58 +08:00
|
|
|
return ngx_sprintf(buf, "%T.%03M", tp->sec, tp->msec);
|
2004-08-29 11:55:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op)
|
|
|
|
{
|
2007-04-21 15:50:19 +08:00
|
|
|
ngx_time_t *tp;
|
|
|
|
ngx_msec_int_t ms;
|
2005-03-01 23:20:36 +08:00
|
|
|
|
2007-04-21 15:50:19 +08:00
|
|
|
tp = ngx_timeofday();
|
|
|
|
|
|
|
|
ms = (tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec);
|
|
|
|
ms = (ms >= 0) ? ms : 0;
|
2005-03-01 23:20:36 +08:00
|
|
|
|
2007-04-21 15:50:19 +08:00
|
|
|
return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000);
|
2005-03-01 23:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static u_char *
|
|
|
|
ngx_http_log_status(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
2004-10-21 23:34:38 +08:00
|
|
|
return ngx_sprintf(buf, "%ui",
|
|
|
|
r->err_status ? r->err_status : r->headers_out.status);
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_http_log_bytes_sent(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
2004-10-21 23:34:38 +08:00
|
|
|
return ngx_sprintf(buf, "%O", r->connection->sent);
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-07-06 19:28:20 +08:00
|
|
|
/*
|
|
|
|
* although there is a real $body_bytes_sent variable,
|
|
|
|
* this log operation code function is more optimized for logging
|
|
|
|
*/
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
2005-11-15 21:30:52 +08:00
|
|
|
ngx_http_log_body_bytes_sent(ngx_http_request_t *r, u_char *buf,
|
2005-03-01 23:20:36 +08:00
|
|
|
ngx_http_log_op_t *op)
|
2003-12-15 04:10:27 +08:00
|
|
|
{
|
2005-03-01 23:20:36 +08:00
|
|
|
off_t length;
|
|
|
|
|
|
|
|
length = r->connection->sent - r->header_size;
|
|
|
|
|
|
|
|
if (length > 0) {
|
|
|
|
return ngx_sprintf(buf, "%O", length);
|
|
|
|
}
|
|
|
|
|
|
|
|
*buf = '0';
|
|
|
|
|
|
|
|
return buf + 1;
|
2003-12-15 04:10:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static u_char *
|
|
|
|
ngx_http_log_request_length(ngx_http_request_t *r, u_char *buf,
|
|
|
|
ngx_http_log_op_t *op)
|
2004-12-06 22:45:08 +08:00
|
|
|
{
|
2006-07-08 00:33:19 +08:00
|
|
|
return ngx_sprintf(buf, "%O", r->request_length);
|
2004-12-06 22:45:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-15 21:30:52 +08:00
|
|
|
static ngx_int_t
|
2005-03-19 20:38:37 +08:00
|
|
|
ngx_http_log_variable_compile(ngx_conf_t *cf, ngx_http_log_op_t *op,
|
|
|
|
ngx_str_t *value)
|
|
|
|
{
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 22:58:06 +08:00
|
|
|
ngx_int_t index;
|
2005-03-19 20:38:37 +08:00
|
|
|
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 22:58:06 +08:00
|
|
|
index = ngx_http_get_variable_index(cf, value);
|
|
|
|
if (index == NGX_ERROR) {
|
2005-03-19 20:38:37 +08:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
op->len = 0;
|
|
|
|
op->getlen = ngx_http_log_variable_getlen;
|
|
|
|
op->run = ngx_http_log_variable;
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 22:58:06 +08:00
|
|
|
op->data = index;
|
2005-03-19 20:38:37 +08:00
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static size_t
|
|
|
|
ngx_http_log_variable_getlen(ngx_http_request_t *r, uintptr_t data)
|
|
|
|
{
|
|
|
|
ngx_http_variable_value_t *value;
|
|
|
|
|
|
|
|
value = ngx_http_get_indexed_variable(r, data);
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
if (value == NULL || value->not_found) {
|
2005-03-19 20:38:37 +08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
return value->len;
|
2005-03-19 20:38:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static u_char *
|
|
|
|
ngx_http_log_variable(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
|
|
|
|
{
|
|
|
|
ngx_http_variable_value_t *value;
|
|
|
|
|
|
|
|
value = ngx_http_get_indexed_variable(r, op->data);
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
if (value == NULL || value->not_found) {
|
2005-03-19 20:38:37 +08:00
|
|
|
*buf = '-';
|
|
|
|
return buf + 1;
|
|
|
|
}
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
return ngx_cpymem(buf, value->data, value->len);
|
2005-03-19 20:38:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static void *
|
|
|
|
ngx_http_log_create_main_conf(ngx_conf_t *cf)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
|
|
|
ngx_http_log_main_conf_t *conf;
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_http_log_fmt_t *fmt;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_main_conf_t));
|
|
|
|
if (conf == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
if (ngx_array_init(&conf->formats, cf->pool, 4, sizeof(ngx_http_log_fmt_t))
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
!= NGX_OK)
|
2005-03-01 23:20:36 +08:00
|
|
|
{
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
fmt = ngx_array_push(&conf->formats);
|
|
|
|
if (fmt == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
fmt->name.len = sizeof("combined") - 1;
|
|
|
|
fmt->name.data = (u_char *) "combined";
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
fmt->ops = ngx_array_create(cf->pool, 16, sizeof(ngx_http_log_op_t));
|
|
|
|
if (fmt->ops == NULL) {
|
2005-10-24 23:09:41 +08:00
|
|
|
return NGX_CONF_ERROR;
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static void *
|
|
|
|
ngx_http_log_create_loc_conf(ngx_conf_t *cf)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
|
|
|
ngx_http_log_loc_conf_t *conf;
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_loc_conf_t));
|
|
|
|
if (conf == NULL) {
|
2004-09-16 00:00:43 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
return conf;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static char *
|
|
|
|
ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
|
|
|
ngx_http_log_loc_conf_t *prev = parent;
|
|
|
|
ngx_http_log_loc_conf_t *conf = child;
|
|
|
|
|
|
|
|
ngx_http_log_t *log;
|
|
|
|
ngx_http_log_fmt_t *fmt;
|
|
|
|
ngx_http_log_main_conf_t *lmcf;
|
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
if (conf->logs || conf->off) {
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
*conf = *prev;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
if (conf->logs || conf->off) {
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
2004-09-16 00:00:43 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
conf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t));
|
|
|
|
if (conf->logs == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
log = ngx_array_push(conf->logs);
|
|
|
|
if (log == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
log->file = ngx_conf_open_file(cf->cycle, &ngx_http_access_log);
|
|
|
|
if (log->file == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
log->disk_full_time = 0;
|
|
|
|
log->error_log_time = 0;
|
2006-12-12 23:46:53 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
|
|
|
|
fmt = lmcf->formats.elts;
|
2004-09-16 00:00:43 +08:00
|
|
|
|
2007-01-24 17:15:25 +08:00
|
|
|
/* the default "combined" format */
|
|
|
|
log->ops = fmt[0].ops;
|
|
|
|
lmcf->combined_used = 1;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static char *
|
|
|
|
ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
|
|
|
ngx_http_log_loc_conf_t *llcf = conf;
|
|
|
|
|
2005-10-27 23:46:13 +08:00
|
|
|
ssize_t buf;
|
2004-03-16 15:10:12 +08:00
|
|
|
ngx_uint_t i;
|
2003-11-10 04:03:38 +08:00
|
|
|
ngx_str_t *value, name;
|
|
|
|
ngx_http_log_t *log;
|
|
|
|
ngx_http_log_fmt_t *fmt;
|
|
|
|
ngx_http_log_main_conf_t *lmcf;
|
|
|
|
|
2004-09-16 00:00:43 +08:00
|
|
|
value = cf->args->elts;
|
|
|
|
|
|
|
|
if (ngx_strcmp(value[1].data, "off") == 0) {
|
|
|
|
llcf->off = 1;
|
|
|
|
return NGX_CONF_OK;
|
|
|
|
}
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
if (llcf->logs == NULL) {
|
2004-09-16 00:00:43 +08:00
|
|
|
llcf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t));
|
|
|
|
if (llcf->logs == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-16 00:35:51 +08:00
|
|
|
lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
log = ngx_array_push(llcf->logs);
|
|
|
|
if (log == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
log->file = ngx_conf_open_file(cf->cycle, &value[1]);
|
|
|
|
if (log->file == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
2006-04-14 17:53:38 +08:00
|
|
|
log->disk_full_time = 0;
|
2007-01-22 03:01:01 +08:00
|
|
|
log->error_log_time = 0;
|
2006-04-14 17:53:38 +08:00
|
|
|
|
2005-10-27 23:46:13 +08:00
|
|
|
if (cf->args->nelts >= 3) {
|
2003-11-10 04:03:38 +08:00
|
|
|
name = value[2];
|
2005-11-26 18:11:11 +08:00
|
|
|
|
|
|
|
if (ngx_strcmp(name.data, "combined") == 0) {
|
|
|
|
lmcf->combined_used = 1;
|
|
|
|
}
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
} else {
|
|
|
|
name.len = sizeof("combined") - 1;
|
2004-03-17 05:26:01 +08:00
|
|
|
name.data = (u_char *) "combined";
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
lmcf->combined_used = 1;
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
fmt = lmcf->formats.elts;
|
|
|
|
for (i = 0; i < lmcf->formats.nelts; i++) {
|
|
|
|
if (fmt[i].name.len == name.len
|
|
|
|
&& ngx_strcasecmp(fmt[i].name.data, name.data) == 0)
|
|
|
|
{
|
|
|
|
log->ops = fmt[i].ops;
|
2005-10-27 23:46:13 +08:00
|
|
|
goto buffer;
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-09 22:31:07 +08:00
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"unknown log format \"%V\"", &name);
|
|
|
|
return NGX_CONF_ERROR;
|
2005-10-27 23:46:13 +08:00
|
|
|
|
|
|
|
buffer:
|
|
|
|
|
|
|
|
if (cf->args->nelts == 4) {
|
|
|
|
if (ngx_strncmp(value[3].data, "buffer=", 7) != 0) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"invalid parameter \"%V\"", &value[3]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
name.len = value[3].len - 7;
|
|
|
|
name.data = value[3].data + 7;
|
|
|
|
|
|
|
|
buf = ngx_parse_size(&name);
|
|
|
|
|
|
|
|
if (buf == NGX_ERROR) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"invalid parameter \"%V\"", &value[3]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (log->file->buffer && log->file->last - log->file->pos != buf) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"access_log \"%V\" already defined "
|
|
|
|
"with different buffer size", &value[1]);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
log->file->buffer = ngx_palloc(cf->pool, buf);
|
|
|
|
if (log->file->buffer == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
log->file->pos = log->file->buffer;
|
|
|
|
log->file->last = log->file->buffer + buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-01 23:20:36 +08:00
|
|
|
static char *
|
|
|
|
ngx_http_log_set_format(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
|
|
|
ngx_http_log_main_conf_t *lmcf = conf;
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_str_t *value;
|
|
|
|
ngx_uint_t i;
|
|
|
|
ngx_http_log_fmt_t *fmt;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
|
|
|
value = cf->args->elts;
|
|
|
|
|
|
|
|
fmt = lmcf->formats.elts;
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
for (i = 0; i < lmcf->formats.nelts; i++) {
|
|
|
|
if (fmt[i].name.len == value[1].len
|
|
|
|
&& ngx_strcmp(fmt[i].name.data, value[1].data) == 0)
|
2003-11-10 04:03:38 +08:00
|
|
|
{
|
|
|
|
return "duplicate \"log_format\" name";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
fmt = ngx_array_push(&lmcf->formats);
|
|
|
|
if (fmt == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt->name = value[1];
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
fmt->ops = ngx_array_create(cf->pool, 16, sizeof(ngx_http_log_op_t));
|
2005-03-19 20:38:37 +08:00
|
|
|
if (fmt->ops == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
return ngx_http_log_compile_format(cf, fmt->ops, cf->args, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static char *
|
|
|
|
ngx_http_log_compile_format(ngx_conf_t *cf, ngx_array_t *ops,
|
|
|
|
ngx_array_t *args, ngx_uint_t s)
|
|
|
|
{
|
2006-11-27 22:46:15 +08:00
|
|
|
u_char *data, *p, ch;
|
|
|
|
size_t i, len;
|
|
|
|
ngx_str_t *value, var;
|
|
|
|
ngx_uint_t bracket;
|
|
|
|
ngx_http_log_op_t *op;
|
|
|
|
ngx_http_log_var_t *v;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
value = args->elts;
|
|
|
|
|
|
|
|
for ( /* void */ ; s < args->nelts; s++) {
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2006-11-27 22:46:15 +08:00
|
|
|
for (i = 0; i < value[s].len; i++) {
|
|
|
|
if (value[s].data[i] != '%') {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
ch = value[s].data[i + 1];
|
|
|
|
|
|
|
|
if ((ch >= 'A' && ch <= 'Z')
|
|
|
|
|| (ch >= 'a' && ch <= 'z')
|
|
|
|
|| ch == '{')
|
|
|
|
{
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"the parameters in the \"%%name\" form are not supported, "
|
|
|
|
"use the \"$variable\" instead");
|
|
|
|
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
i = 0;
|
|
|
|
|
|
|
|
while (i < value[s].len) {
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
op = ngx_array_push(ops);
|
2005-03-19 20:38:37 +08:00
|
|
|
if (op == NULL) {
|
2003-11-10 04:03:38 +08:00
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
data = &value[s].data[i];
|
|
|
|
|
2006-11-27 22:46:15 +08:00
|
|
|
if (value[s].data[i] == '$') {
|
2005-10-24 23:09:41 +08:00
|
|
|
|
|
|
|
if (++i == value[s].len) {
|
|
|
|
goto invalid;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (value[s].data[i] == '{') {
|
|
|
|
bracket = 1;
|
|
|
|
|
|
|
|
if (++i == value[s].len) {
|
|
|
|
goto invalid;
|
|
|
|
}
|
|
|
|
|
|
|
|
var.data = &value[s].data[i];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
bracket = 0;
|
|
|
|
var.data = &value[s].data[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var.len = 0; i < value[s].len; i++, var.len++) {
|
|
|
|
ch = value[s].data[i];
|
|
|
|
|
|
|
|
if (ch == '}' && bracket) {
|
|
|
|
i++;
|
|
|
|
bracket = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((ch >= 'A' && ch <= 'Z')
|
|
|
|
|| (ch >= 'a' && ch <= 'z')
|
|
|
|
|| (ch >= '0' && ch <= '9')
|
|
|
|
|| ch == '_')
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-10-24 23:09:41 +08:00
|
|
|
if (bracket) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
|
|
|
"the closing bracket in \"%V\" "
|
|
|
|
"variable is missing", &var);
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (var.len == 0) {
|
|
|
|
goto invalid;
|
|
|
|
}
|
|
|
|
|
2005-11-15 21:30:52 +08:00
|
|
|
if (ngx_strncmp(var.data, "apache_bytes_sent", 17) == 0) {
|
|
|
|
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
|
|
"use \"$body_bytes_sent\" instead of "
|
|
|
|
"\"$apache_bytes_sent\"");
|
|
|
|
}
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
for (v = ngx_http_log_vars; v->name.len; v++) {
|
|
|
|
|
|
|
|
if (v->name.len == var.len
|
|
|
|
&& ngx_strncmp(v->name.data, var.data, var.len) == 0)
|
|
|
|
{
|
|
|
|
op->len = v->len;
|
|
|
|
op->getlen = NULL;
|
|
|
|
op->run = v->run;
|
|
|
|
op->data = 0;
|
|
|
|
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-10-24 23:09:41 +08:00
|
|
|
if (ngx_http_log_variable_compile(cf, op, &var) != NGX_OK) {
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
found:
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
continue;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
i++;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2006-11-27 22:46:15 +08:00
|
|
|
while (i < value[s].len && value[s].data[i] != '$') {
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
i++;
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
len = &value[s].data[i] - data;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
if (len) {
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
op->len = len;
|
|
|
|
op->getlen = NULL;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
if (len <= sizeof(uintptr_t)) {
|
|
|
|
op->run = ngx_http_log_copy_short;
|
|
|
|
op->data = 0;
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
while (len--) {
|
|
|
|
op->data <<= 8;
|
|
|
|
op->data |= data[len];
|
|
|
|
}
|
2003-11-10 04:03:38 +08:00
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
} else {
|
|
|
|
op->run = ngx_http_log_copy_long;
|
|
|
|
|
|
|
|
p = ngx_palloc(cf->pool, len);
|
|
|
|
if (p == NULL) {
|
|
|
|
return NGX_CONF_ERROR;
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
|
|
|
|
ngx_memcpy(p, data, len);
|
|
|
|
op->data = (uintptr_t) p;
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_CONF_OK;
|
2005-10-24 23:09:41 +08:00
|
|
|
|
|
|
|
invalid:
|
|
|
|
|
|
|
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%s\"", data);
|
|
|
|
|
|
|
|
return NGX_CONF_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static ngx_int_t
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_http_log_init(ngx_conf_t *cf)
|
2005-10-24 23:09:41 +08:00
|
|
|
{
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_str_t *value;
|
|
|
|
ngx_array_t a;
|
2005-11-26 18:11:11 +08:00
|
|
|
ngx_http_handler_pt *h;
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
ngx_http_log_fmt_t *fmt;
|
|
|
|
ngx_http_log_main_conf_t *lmcf;
|
2005-10-24 23:09:41 +08:00
|
|
|
ngx_http_core_main_conf_t *cmcf;
|
|
|
|
|
nginx-0.3.8-RELEASE import
*) Security: nginx now checks URI got from a backend in
"X-Accel-Redirect" header line or in SSI file for the "/../" paths
and zeroes.
*) Change: nginx now does not treat the empty user name in the
"Authorization" header line as valid one.
*) Feature: the "ssl_session_timeout" directives of the
ngx_http_ssl_module and ngx_imap_ssl_module.
*) Feature: the "auth_http_header" directive of the
ngx_imap_auth_http_module.
*) Feature: the "add_header" directive.
*) Feature: the ngx_http_realip_module.
*) Feature: the new variables to use in the "log_format" directive:
$bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
$request_time, $request_length, $upstream_status,
$upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
$connection, $pipe, and $msec. The parameters in the "%name" form
will be canceled soon.
*) Change: now the false variable values in the "if" directive are the
empty string "" and string starting with "0".
*) Bugfix: while using proxied or FastCGI-server nginx may leave
connections and temporary files with client requests in open state.
*) Bugfix: the worker processes did not flush the buffered logs on
graceful exit.
*) Bugfix: if the request URI was changes by the "rewrite" directive
and the request was proxied in location given by regular expression,
then the incorrect request was transferred to backend; the bug had
appeared in 0.2.6.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" header.
*) Bugfix: nginx may stop to accept requests if the "rtsig" method and
several worker processes were used.
*) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
SSI commands.
*) Bugfix: if the response was ended just after the SSI command and
gzipping was used, then the response did not transferred complete or
did not transferred at all.
2005-11-10 01:25:55 +08:00
|
|
|
lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
|
|
|
|
|
|
|
|
if (lmcf->combined_used) {
|
|
|
|
if (ngx_array_init(&a, cf->pool, 1, sizeof(ngx_str_t)) != NGX_OK) {
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
value = ngx_array_push(&a);
|
|
|
|
if (value == NULL) {
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
*value = ngx_http_combined_fmt;
|
|
|
|
fmt = lmcf->formats.elts;
|
|
|
|
|
|
|
|
if (ngx_http_log_compile_format(cf, fmt->ops, &a, 0)
|
|
|
|
!= NGX_CONF_OK)
|
|
|
|
{
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
|
2005-10-24 23:09:41 +08:00
|
|
|
|
2005-11-26 18:11:11 +08:00
|
|
|
h = ngx_array_push(&cmcf->phases[NGX_HTTP_LOG_PHASE].handlers);
|
|
|
|
if (h == NULL) {
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
*h = ngx_http_log_handler;
|
2005-10-24 23:09:41 +08:00
|
|
|
|
|
|
|
return NGX_OK;
|
2003-11-10 04:03:38 +08:00
|
|
|
}
|