]> git.kaiwu.me - nginx.git/log
nginx.git
14 years agoConfigure: moved icc detection before gcc.
Maxim Dounin [Mon, 27 Feb 2012 16:23:44 +0000 (16:23 +0000)]
Configure: moved icc detection before gcc.

New versions of icc confuse auto/cc/name due to introduced handling
of a "icc -v":

$ icc -v
icc version 12.1.3 (gcc version 4.6.0 compatibility)
$ icc -V
Intel(R) C Compiler XE for applications running on IA-32, Version 12.1.3.293 Build 20120212
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

See report here:
http://mailman.nginx.org/pipermail/nginx/2012-February/032177.html

14 years agoAdded support for the 307 Temporary Redirect.
Ruslan Ermilov [Mon, 27 Feb 2012 11:43:40 +0000 (11:43 +0000)]
Added support for the 307 Temporary Redirect.

14 years agoRenamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov [Wed, 22 Feb 2012 16:23:29 +0000 (16:23 +0000)]
Renamed constants and fixed off-by-one error in "msie_padding on" handling.

14 years agoEvent pipe: fixed buffer loss in p->length case.
Maxim Dounin [Wed, 22 Feb 2012 11:28:53 +0000 (11:28 +0000)]
Event pipe: fixed buffer loss in p->length case.

With previous code raw buffer might be lost if p->input_filter() was called
on a buffer without any data and used ngx_event_pipe_add_free_buf() to
return it to the free list.  This eventually might cause "all buffers busy"
problem, resulting in segmentation fault due to null pointer dereference in
ngx_event_pipe_write_chain_to_temp_file().

In ngx_event_pipe_add_free_buf() the buffer was added to the list start
due to pos == last, and then "p->free_raw_bufs = cl->next" in
ngx_event_pipe_read_upstream() dropped both chain links to the buffer
from the p->free_raw_bufs list.

Fix is to move "p->free_raw_bufs = cl->next" before calling the
p->input_filter().

14 years agoDisable symlinks: use O_SEARCH|O_DIRECTORY to open path components.
Valentin Bartenev [Tue, 21 Feb 2012 15:10:13 +0000 (15:10 +0000)]
Disable symlinks: use O_SEARCH|O_DIRECTORY to open path components.

14 years agoDisable symlinks: don't allow creating or truncating a file via a symlink in
Valentin Bartenev [Tue, 21 Feb 2012 15:04:41 +0000 (15:04 +0000)]
Disable symlinks: don't allow creating or truncating a file via a symlink in
the last path component if "if_not_owner" parameter is used.

To prevent race condition we have to open a file before checking its owner and
there's no way to change access flags for already opened file descriptor, so
we disable symlinks for the last path component at all if flags allow creating
or truncating the file.

14 years agoDisable symlinks: cleanups once again.
Valentin Bartenev [Tue, 21 Feb 2012 15:01:25 +0000 (15:01 +0000)]
Disable symlinks: cleanups once again.

In collaboration with Ruslan Ermilov.

14 years agoDisable symlinks: added explicit cast of AT_FDCWD (ticket #111).
Maxim Dounin [Mon, 20 Feb 2012 19:14:35 +0000 (19:14 +0000)]
Disable symlinks: added explicit cast of AT_FDCWD (ticket #111).

Solaris has AT_FDCWD defined to unsigned value, and comparison of a file
descriptor with it causes warnings in modern versions of gcc.  Explicitly
cast AT_FDCWD to ngx_fd_t to resolve these warnings.

14 years agoDisable symlinks: error handling cleanup again.
Maxim Dounin [Mon, 20 Feb 2012 19:14:07 +0000 (19:14 +0000)]
Disable symlinks: error handling cleanup again.

14 years agoVersion bump.
Maxim Dounin [Mon, 20 Feb 2012 19:12:48 +0000 (19:12 +0000)]
Version bump.

14 years agorelease-1.1.15 tag
Maxim Dounin [Wed, 15 Feb 2012 13:26:27 +0000 (13:26 +0000)]
release-1.1.15 tag

14 years agonginx-1.1.15-RELEASE release-1.1.15
Maxim Dounin [Wed, 15 Feb 2012 13:26:06 +0000 (13:26 +0000)]
nginx-1.1.15-RELEASE

14 years agoDisable symlinks: fixed edge cases of path handling.
Maxim Dounin [Wed, 15 Feb 2012 12:18:55 +0000 (12:18 +0000)]
Disable symlinks: fixed edge cases of path handling.

This includes non-absolute pathnames, multiple slashes and trailing
slashes.  In collaboration with Valentin Bartenev.

14 years agoDisable symlinks: cleanup error handling.
Maxim Dounin [Wed, 15 Feb 2012 12:17:24 +0000 (12:17 +0000)]
Disable symlinks: cleanup error handling.

Notably this fixes NGX_INVALID_FILE/NGX_FILE_ERROR mess, and adds
logging of close() errors.  In collaboration with Valentin Bartenev.

14 years agoSupport for disable_symlinks in various modules.
Andrey Belov [Mon, 13 Feb 2012 16:32:21 +0000 (16:32 +0000)]
Support for disable_symlinks in various modules.

14 years agoAdded disable_symlinks directive.
Andrey Belov [Mon, 13 Feb 2012 16:29:04 +0000 (16:29 +0000)]
Added disable_symlinks directive.

To completely disable symlinks (disable_symlinks on)
we use openat(O_NOFOLLOW) for each path component
to avoid races.

To allow symlinks with the same owner (disable_symlinks if_not_owner),
use openat() (followed by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW),
and then compare uids between fstat() and fstatat().

As there is a race between openat() and fstatat() we don't
know if openat() in fact opened symlink or not.  Therefore,
we have to compare uids even if fstatat() reports the opened
component isn't a symlink (as we don't know whether it was
symlink during openat() or not).

Default value is off, i.e. symlinks are allowed.

14 years agoChanged ngx_open_and_stat_file() to use ngx_str_t.
Andrey Belov [Mon, 13 Feb 2012 16:16:45 +0000 (16:16 +0000)]
Changed ngx_open_and_stat_file() to use ngx_str_t.

No functional changes.

14 years agoAdded openat()/fstatat().
Andrey Belov [Mon, 13 Feb 2012 16:13:21 +0000 (16:13 +0000)]
Added openat()/fstatat().

14 years agoTime parsing cleanup.
Maxim Dounin [Mon, 13 Feb 2012 15:41:11 +0000 (15:41 +0000)]
Time parsing cleanup.

Nuke NGX_PARSE_LARGE_TIME, it's not used since 0.6.30.  The only error
ngx_parse_time() can currently return is NGX_ERROR, check it explicitly
and make sure to cast it to appropriate type (either time_t or ngx_msec_t)
to avoid signedness warnings on platforms with unsigned time_t (notably QNX).

14 years agoFixed build with embedded perl and --with-openssl.
Maxim Dounin [Mon, 13 Feb 2012 15:38:48 +0000 (15:38 +0000)]
Fixed build with embedded perl and --with-openssl.

14 years agoCore: protection from cycles with named locations and post_action.
Maxim Dounin [Mon, 13 Feb 2012 15:35:48 +0000 (15:35 +0000)]
Core: protection from cycles with named locations and post_action.

Now redirects to named locations are counted against normal uri changes
limit, and post_action respects this limit as well.  As a result at least
the following (bad) configurations no longer trigger infinite cycles:

1. Post action which recursively triggers post action:

    location / {
        post_action /index.html;
    }

2. Post action pointing to nonexistent named location:

    location / {
        post_action @nonexistent;
    }

3. Recursive error page for 500 (Internal Server Error) pointing to
   a nonexistent named location:

    location / {
        recursive_error_pages on;
        error_page 500 @nonexistent;
        return 500;
    }

14 years agoCore: protection from subrequest loops.
Maxim Dounin [Mon, 13 Feb 2012 15:33:08 +0000 (15:33 +0000)]
Core: protection from subrequest loops.

Without the protection, subrequest loop results in r->count overflow and
SIGSEGV.  Protection was broken in 0.7.25.

Note that this also limits number of parallel subrequests.  This
wasn't exactly the case before 0.7.25 as local subrequests were
completed directly.

See here for details:
http://nginx.org/pipermail/nginx-ru/2010-February/032184.html

14 years agoVariables: honor no_cacheable for not_found variables.
Maxim Dounin [Mon, 13 Feb 2012 15:31:07 +0000 (15:31 +0000)]
Variables: honor no_cacheable for not_found variables.

Variables with the "not_found" flag set follow the same rules as ones with
the "valid" flag set.  Make sure ngx_http_get_flushed_variable() will flush
non-cacheable variables with the "not_found" flag set.

This fixes at least one known problem with $args not available in a subrequest
(with args) when there were no args in the main request and $args variable was
queried in the main request (reported by Laurence Rowe aka elro on irc).

Also this eliminates unneeded call to ngx_http_get_indexed_variable() in
cacheable case (as it will return cached value anyway).

14 years agoFix for proxy_store leaving temporary files for subrequests.
Maxim Dounin [Mon, 13 Feb 2012 15:28:19 +0000 (15:28 +0000)]
Fix for proxy_store leaving temporary files for subrequests.

Temporary files might not be removed if the "proxy_store" or "fastcgi_store"
directives were used for subrequests (e.g. ssi includes) and client closed
connection prematurely.

Non-active subrequests are finalized out of the control of the upstream
module when client closes a connection.  As a result, the code to remove
unfinished temporary files in ngx_http_upstream_process_request() wasn't
executed.

Fix is to move relevant code into ngx_http_upstream_finalize_request() which
is called in all cases, either directly or via the cleanup handler.

14 years agoGzip filter: handling of empty flush buffers.
Maxim Dounin [Mon, 13 Feb 2012 15:23:43 +0000 (15:23 +0000)]
Gzip filter: handling of empty flush buffers.

Empty flush buffers are legitimate and may happen e.g. due to $r->flush()
calls in embedded perl.  If there are no data buffered in zlib, deflate()
will return Z_BUF_ERROR (i.e. no progress possible) without adding anything
to output.  Don't treat Z_BUF_ERROR as fatal and correctly send empty flush
buffer if we have no data in output at all.

See this thread for details:
http://mailman.nginx.org/pipermail/nginx/2010-November/023693.html

14 years agoRemoved r->cache/r->cached dependencies in range filter.
Maxim Dounin [Mon, 13 Feb 2012 15:20:49 +0000 (15:20 +0000)]
Removed r->cache/r->cached dependencies in range filter.

This is a layering violation, use correct offset calculations instead.

14 years agoProxy: added the "proxy_cookie_path" directive.
Valentin Bartenev [Mon, 13 Feb 2012 11:08:05 +0000 (11:08 +0000)]
Proxy: added the "proxy_cookie_path" directive.

14 years agoProxy: added the "proxy_cookie_domain" directive.
Valentin Bartenev [Mon, 13 Feb 2012 11:04:45 +0000 (11:04 +0000)]
Proxy: added the "proxy_cookie_domain" directive.

14 years agoUpstream: added callback hook for the "Set-Cookie" header.
Valentin Bartenev [Mon, 13 Feb 2012 11:01:58 +0000 (11:01 +0000)]
Upstream: added callback hook for the "Set-Cookie" header.

No functional changes.

14 years agoProxy: generic regex related code from the "proxy_redirect" directive moved
Valentin Bartenev [Mon, 13 Feb 2012 11:00:08 +0000 (11:00 +0000)]
Proxy: generic regex related code from the "proxy_redirect" directive moved
to a separate function.

No functional changes.

14 years agoProxy: generic rewrite code from the "proxy_redirect" handlers moved to a
Valentin Bartenev [Mon, 13 Feb 2012 10:56:09 +0000 (10:56 +0000)]
Proxy: generic rewrite code from the "proxy_redirect" handlers moved to a
separate function with trivial optimization.

No functional changes.

14 years agoProxy: renamed some "proxy_redirect" related declarations to a more general and
Valentin Bartenev [Mon, 13 Feb 2012 10:42:44 +0000 (10:42 +0000)]
Proxy: renamed some "proxy_redirect" related declarations to a more general and
reusable.

No functional changes.

14 years agoUpstream: fixed "too big header" check.
Maxim Dounin [Fri, 10 Feb 2012 14:31:04 +0000 (14:31 +0000)]
Upstream: fixed "too big header" check.

If header filter postponed processing of a header by returning NGX_AGAIN
and not moved u->buffer->pos, previous check incorrectly assumed there
is additional space and did another recv() with zero-size buffer.  This
resulted in "upstream prematurely closed connection" error instead
of correct "upstream sent too big header" one.

Patch by Feibo Li.

14 years agoAdded ngx_ncpu detection for most *nix platforms.
Valentin Bartenev [Fri, 10 Feb 2012 11:24:19 +0000 (11:24 +0000)]
Added ngx_ncpu detection for most *nix platforms.

This inaccurate detection by using sysconf(_SC_NPROCESSORS_ONLN) can improve
usage of the mutex lock optimization on multicore systems.

14 years agoLimit conn: returned to the old behavior of using the first actual limit on
Valentin Bartenev [Fri, 10 Feb 2012 10:48:58 +0000 (10:48 +0000)]
Limit conn: returned to the old behavior of using the first actual limit on
the way.

It was unintentionally changed in r4272, so that it could only limit the first
location where the processing of the request has reached PREACCESS phase.

14 years agoFixed module name in comment. It was forgotten in r4281.
Valentin Bartenev [Fri, 10 Feb 2012 09:56:37 +0000 (09:56 +0000)]
Fixed module name in comment. It was forgotten in r4281.

14 years agoVersion bump.
Maxim Dounin [Thu, 9 Feb 2012 16:18:02 +0000 (16:18 +0000)]
Version bump.

14 years agorelease-1.1.14 tag
Maxim Dounin [Mon, 30 Jan 2012 13:52:35 +0000 (13:52 +0000)]
release-1.1.14 tag

14 years agonginx-1.1.14-RELEASE release-1.1.14
Maxim Dounin [Mon, 30 Jan 2012 13:52:10 +0000 (13:52 +0000)]
nginx-1.1.14-RELEASE

14 years agoUpdate OpenSSL and PCRE used for win32 builds.
Maxim Dounin [Mon, 30 Jan 2012 13:47:03 +0000 (13:47 +0000)]
Update OpenSSL and PCRE used for win32 builds.

14 years agoLimit req: unbreak compilation with MSVC.
Maxim Dounin [Mon, 30 Jan 2012 13:19:25 +0000 (13:19 +0000)]
Limit req: unbreak compilation with MSVC.

14 years agoFixed memory leak on HUP signal when PCRE JIT was used.
Valentin Bartenev [Mon, 30 Jan 2012 12:53:57 +0000 (12:53 +0000)]
Fixed memory leak on HUP signal when PCRE JIT was used.

The PCRE JIT compiler uses mmap to allocate memory for its executable codes, so
we have to explicitly call the pcre_free_study() function to free this memory.

14 years agoFixed proxy_redirect off inheritance.
Valentin Bartenev [Mon, 30 Jan 2012 11:22:56 +0000 (11:22 +0000)]
Fixed proxy_redirect off inheritance.

Example configuration to reproduce:

  server {
      proxy_redirect off;

      location / {
          proxy_pass http://localhost:8000;
          proxy_redirect http://localhost:8000/ /;

          location ~ \.php$ {
              proxy_pass http://localhost:8000;
              # proxy_redirect must be inherited from the level above,
              # but instead it was switched off here
          }
      }
  }

14 years agoFixed error handling in ngx_event_connect_peer().
Maxim Dounin [Mon, 30 Jan 2012 11:12:52 +0000 (11:12 +0000)]
Fixed error handling in ngx_event_connect_peer().

Previously if ngx_add_event() failed a connection was freed two times (once
in the ngx_event_connect_peer(), and again by a caller) as pc->connection was
left set.  Fix is to always use ngx_close_connection() to close connection
properly and set pc->connection to NULL on errors.

Patch by Piotr Sikora.

14 years agoLimit req: support for multiple "limit_req" limits.
Valentin Bartenev [Mon, 30 Jan 2012 10:17:56 +0000 (10:17 +0000)]
Limit req: support for multiple "limit_req" limits.

14 years agoLimit req: number of cleanup calls reduced.
Valentin Bartenev [Mon, 30 Jan 2012 10:01:39 +0000 (10:01 +0000)]
Limit req: number of cleanup calls reduced.

Doing a cleanup before every lookup seems to be too aggressive. It can lead to
premature removal of the nodes still usable, which increases the amount of work
under a mutex lock and therefore decreases performance.

In order to improve cleanup behavior, cleanup function call has been moved right
before the allocation of a new node.

14 years agoLimit req: allocation and initialization of a new node moved to the lookup
Valentin Bartenev [Mon, 30 Jan 2012 09:41:49 +0000 (09:41 +0000)]
Limit req: allocation and initialization of a new node moved to the lookup
function.

No functional changes.

14 years agoLimit req: improved error handling when parsing "zone" parameter of
Valentin Bartenev [Mon, 30 Jan 2012 09:26:08 +0000 (09:26 +0000)]
Limit req: improved error handling when parsing "zone" parameter of
"limit_req_zone" directive; minimum size of zone is increased.

Previously an unsigned variable was used to keep the return value of
ngx_parse_size() function, which led to an incorrect zone size if NGX_ERROR
was returned.

The new code has been taken from the "limit_conn_zone" directive.

14 years agoLimit req: error messages fixed.
Valentin Bartenev [Mon, 30 Jan 2012 09:02:29 +0000 (09:02 +0000)]
Limit req: error messages fixed.

14 years agoFixed AIO error handling on FreeBSD.
Maxim Dounin [Mon, 30 Jan 2012 07:39:47 +0000 (07:39 +0000)]
Fixed AIO error handling on FreeBSD.

The aio_return() must be called regardless of the error returned by
aio_error().  Not calling it resulted in various problems up to segmentation
faults (as AIO events are level-triggered and were reported again and again).

Additionally, in "aio sendfile" case r->blocked was incremented in case of
error returned from ngx_file_aio_read(), thus causing request hangs.

14 years agoRemoved ENGINE_load_builtin_engines() call.
Maxim Dounin [Mon, 30 Jan 2012 07:38:27 +0000 (07:38 +0000)]
Removed ENGINE_load_builtin_engines() call.

It's already called by OPENSSL_config().  Calling it again causes some
openssl engines (notably GOST) to corrupt memory, as they don't expect
to be created more than once.

14 years agoFixed grammar in PCRE JIT error log message.
Valentin Bartenev [Tue, 24 Jan 2012 10:20:42 +0000 (10:20 +0000)]
Fixed grammar in PCRE JIT error log message.

14 years agoCopyright updated.
Maxim Konovalov [Wed, 18 Jan 2012 15:07:43 +0000 (15:07 +0000)]
Copyright updated.

14 years agoVersion bump.
Maxim Konovalov [Wed, 18 Jan 2012 15:04:17 +0000 (15:04 +0000)]
Version bump.

14 years agoVersion bump.
Maxim Konovalov [Wed, 18 Jan 2012 14:33:17 +0000 (14:33 +0000)]
Version bump.

14 years agoFixed spelling.
Ruslan Ermilov [Tue, 17 Jan 2012 07:09:51 +0000 (07:09 +0000)]
Fixed spelling.

14 years agorelease-1.1.13 tag
Maxim Dounin [Mon, 16 Jan 2012 15:15:01 +0000 (15:15 +0000)]
release-1.1.13 tag

14 years agonginx-1.1.13-RELEASE release-1.1.13
Maxim Dounin [Mon, 16 Jan 2012 15:14:37 +0000 (15:14 +0000)]
nginx-1.1.13-RELEASE

14 years agoUpdated OpenSSL version used for win32 build.
Maxim Dounin [Mon, 16 Jan 2012 15:10:36 +0000 (15:10 +0000)]
Updated OpenSSL version used for win32 build.

14 years ago2012 year.
Igor Sysoev [Mon, 16 Jan 2012 14:31:15 +0000 (14:31 +0000)]
2012 year.

14 years agoFixed division by zero exception in ngx_hash_init().
Valentin Bartenev [Mon, 16 Jan 2012 12:42:07 +0000 (12:42 +0000)]
Fixed division by zero exception in ngx_hash_init().

The ngx_hash_init() function did not expect call with zero elements count,
which caused FPE error on configs with an empty "types" block in http context
and "types_hash_max_size" > 10000.

Example configuration to reproduce:

  events { }

  http {
          types_hash_max_size 10001;
          types {}
          server {}
  }

14 years agoFixed sched_setaffinity(2) to correctly pass size.
Maxim Dounin [Mon, 16 Jan 2012 11:13:48 +0000 (11:13 +0000)]
Fixed sched_setaffinity(2) to correctly pass size.

Second argument (cpusetsize) is size in bytes, not in bits.  Previously
used constant 32 resulted in reading of uninitialized memory and caused
EINVAL to be returned on some Linux kernels.

14 years agoFixed handling of mp4 above 2G and 32bit offsets (ticket #84).
Maxim Dounin [Mon, 16 Jan 2012 11:03:27 +0000 (11:03 +0000)]
Fixed handling of mp4 above 2G and 32bit offsets (ticket #84).

14 years agoFixed proxy_cache_use_stale in "no live upstreams" case.
Maxim Dounin [Mon, 16 Jan 2012 11:01:52 +0000 (11:01 +0000)]
Fixed proxy_cache_use_stale in "no live upstreams" case.

14 years agoAdded support for TLSv1.1, TLSv1.2 in ssl_protocols directive.
Maxim Dounin [Wed, 11 Jan 2012 11:15:00 +0000 (11:15 +0000)]
Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive.

Support for TLSv1.1 and TLSv1.2 protocols was introduced in OpenSSL 1.0.1
(-beta1 was recently released).  This change makes it possible to disable
these protocols and/or enable them without other protocols.

14 years agoFixed limit_req burst/nodelay inheritance (ticket #76).
Maxim Dounin [Wed, 11 Jan 2012 11:09:05 +0000 (11:09 +0000)]
Fixed limit_req burst/nodelay inheritance (ticket #76).

The problem was introduced in r4381 (1.1.12).

14 years agoFixed: proxy_redirect with regex might broke Refresh header.
Valentin Bartenev [Tue, 10 Jan 2012 15:09:45 +0000 (15:09 +0000)]
Fixed: proxy_redirect with regex might broke Refresh header.

The problem was localized in ngx_http_proxy_rewrite_redirect_regex() handler
function which did not take into account prefix when overwriting header value.

14 years agoChanged ngx_log_debugN() macros to verify the number of arguments
Ruslan Ermilov [Tue, 10 Jan 2012 07:28:32 +0000 (07:28 +0000)]
Changed ngx_log_debugN() macros to verify the number of arguments
when built with debugging.

14 years agoFixed configure with system PCRE library on Solaris.
Valentin Bartenev [Thu, 29 Dec 2011 15:58:53 +0000 (15:58 +0000)]
Fixed configure with system PCRE library on Solaris.
The bug has been introduced in r4389.

14 years agoSome questionable optomizations flags for icc were removed
Maxim Konovalov [Thu, 29 Dec 2011 15:36:07 +0000 (15:36 +0000)]
Some questionable optomizations flags for icc were removed
in order to simplify support of its future versions.

14 years agoFixed punctuation.
Maxim Dounin [Wed, 28 Dec 2011 13:30:56 +0000 (13:30 +0000)]
Fixed punctuation.

14 years agolibraries versions updated
Sergey Budnevitch [Tue, 27 Dec 2011 12:39:11 +0000 (12:39 +0000)]
libraries versions updated

14 years agozlib license file include fixed
Sergey Budnevitch [Tue, 27 Dec 2011 12:35:52 +0000 (12:35 +0000)]
zlib license file include fixed

14 years agoVersion bump.
Maxim Dounin [Tue, 27 Dec 2011 11:56:48 +0000 (11:56 +0000)]
Version bump.

14 years agorelease-1.1.12 tag
Maxim Dounin [Mon, 26 Dec 2011 15:05:38 +0000 (15:05 +0000)]
release-1.1.12 tag

14 years agonginx-1.1.12-RELEASE release-1.1.12
Maxim Dounin [Mon, 26 Dec 2011 15:05:17 +0000 (15:05 +0000)]
nginx-1.1.12-RELEASE

14 years agoAdded support for regex study and PCRE JIT (ticket #41) optimizations on
Valentin Bartenev [Mon, 26 Dec 2011 13:10:36 +0000 (13:10 +0000)]
Added support for regex study and PCRE JIT (ticket #41) optimizations on
configuration phase.

14 years agoFixed build without debug.
Maxim Dounin [Mon, 26 Dec 2011 11:33:11 +0000 (11:33 +0000)]
Fixed build without debug.

14 years agoCache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin [Mon, 26 Dec 2011 11:16:19 +0000 (11:16 +0000)]
Cache lock support for fastcgi, scgi, uwsgi.

14 years agoCache locks initial implementation.
Maxim Dounin [Mon, 26 Dec 2011 11:15:23 +0000 (11:15 +0000)]
Cache locks initial implementation.

New directives: proxy_cache_lock on/off, proxy_cache_lock_timeout.  With
proxy_cache_lock set to on, only one request will be allowed to go to
upstream for a particular cache item.  Others will wait for a response
to appear in cache (or cache lock released) up to proxy_cache_lock_timeout.

Waiting requests will recheck if they have cached response ready (or are
allowed to run) every 500ms.

Note: we intentionally don't intercept NGX_DECLINED possibly returned by
ngx_http_file_cache_read().  This needs more work (possibly safe, but needs
further investigation).  Anyway, it's exceptional situation.

Note: probably there should be a way to disable caching of responses
if there is already one request fetching resource to cache (without waiting
at all).  Two possible ways include another cache lock option ("no_cache")
or using proxy_no_cache with some supplied variable.

Note: probably there should be a way to lock updating requests as well.  For
now "proxy_cache_use_stale updating" is available.

14 years agoFixed interaction of limit_rate and sendfile_max_chunk.
Maxim Dounin [Mon, 26 Dec 2011 10:51:24 +0000 (10:51 +0000)]
Fixed interaction of limit_rate and sendfile_max_chunk.

It's possible that configured limit_rate will permit more bytes per
single operation than sendfile_max_chunk.  To protect disk from takeover
by a single client it is necessary to apply sendfile_max_chunk as a limit
regardless of configured limit_rate.

See here for report (in Russian):
http://mailman.nginx.org/pipermail/nginx-ru/2010-March/032806.html

14 years agoFixed throughput problems with large limit_rate.
Maxim Dounin [Mon, 26 Dec 2011 10:49:57 +0000 (10:49 +0000)]
Fixed throughput problems with large limit_rate.

Previous attempt to fix this was in r1658 (0.6.18), though that one wasn't
enough (it was a noop).

14 years agoFixed mp4 if first entry in stsc was skipped (ticket #72).
Maxim Dounin [Mon, 26 Dec 2011 10:49:03 +0000 (10:49 +0000)]
Fixed mp4 if first entry in stsc was skipped (ticket #72).

If first entry in stsc atom was skipped, and seek was to chunk boundary,
than first_chunk in the generated stsc table wasn't set to 1.

14 years agoSSI: added regex captures support in the expression of the "if" command.
Valentin Bartenev [Sun, 25 Dec 2011 20:08:37 +0000 (20:08 +0000)]
SSI: added regex captures support in the expression of the "if" command.

14 years agoFixed limit_conn_log_level/limit_req_log_level inheritance.
Valentin Bartenev [Sun, 25 Dec 2011 19:32:31 +0000 (19:32 +0000)]
Fixed limit_conn_log_level/limit_req_log_level inheritance.

The directives did not work if there were no limit_conn/limit_req specified on
the same level.

14 years agoAdded the HTTPS fastcgi_param to fastcgi.conf.
Valentin Bartenev [Sun, 25 Dec 2011 19:15:56 +0000 (19:15 +0000)]
Added the HTTPS fastcgi_param to fastcgi.conf.

14 years agoWords duplications removed.
Maxim Konovalov [Sat, 24 Dec 2011 06:31:57 +0000 (06:31 +0000)]
Words duplications removed.

14 years agoProxy: made proxy_pass with variables more consistent.
Maxim Dounin [Fri, 23 Dec 2011 16:04:09 +0000 (16:04 +0000)]
Proxy: made proxy_pass with variables more consistent.

If proxy_pass was used with variables and there was no URI component,
nginx always used unparsed URI.  This isn't consistent with "no variables"
case, where e.g. rewrites are applied even if there is no URI component.

Fix is to use the same logic in both cases, i.e. only use unparsed URI if
it's valid and request is the main one.

14 years agoconfigure on Solaris fixed
Sergey Budnevitch [Tue, 20 Dec 2011 16:20:23 +0000 (16:20 +0000)]
configure on Solaris fixed

14 years agoAdded clearing of r->valid_unparsed_uri on internal redirects.
Maxim Dounin [Mon, 19 Dec 2011 14:11:48 +0000 (14:11 +0000)]
Added clearing of r->valid_unparsed_uri on internal redirects.

This resolves issue with try_files (see ticket #70), configuration like

   location / { try_files $uri /index.php; }
   location /index.php { proxy_pass http://backend; }

caused nginx to use original request uri in a request to a backend.

Historically, not clearing of the r->valid_unparsed_uri on internal redirect
was a feature: it allowed to pass the same request to (another) upstream
server via error_page redirection.  Since then named locations appeared
though, and it's time to start resetting r->valid_unparsed_uri on internal
redirects.  Configurations still using this feature should be converted
to use named locations instead.

Patch by Lanshun Zhou.

14 years agoSSI bugfix: the "if" command did not work inside the "block" command and
Valentin Bartenev [Mon, 19 Dec 2011 13:28:22 +0000 (13:28 +0000)]
SSI bugfix: the "if" command did not work inside the "block" command and
produced parsing errors.

14 years agoScgi: removed error if there is no Status header.
Maxim Dounin [Mon, 19 Dec 2011 11:25:40 +0000 (11:25 +0000)]
Scgi: removed error if there is no Status header.

The SCGI specification doesn't specify format of the response, and assuming
CGI specs should be used there is no reason to complain.  RFC 3875
explicitly states that "A Status header field is optional, and status
200 'OK' is assumed if it is omitted".

14 years agoScgi: removed duplicate function declaration.
Maxim Dounin [Mon, 19 Dec 2011 11:24:32 +0000 (11:24 +0000)]
Scgi: removed duplicate function declaration.

14 years agoFixed incorrect use of r->http_version in scgi module.
Maxim Dounin [Mon, 19 Dec 2011 11:23:16 +0000 (11:23 +0000)]
Fixed incorrect use of r->http_version in scgi module.

The r->http_version is a version of client's request, and modules must
not set it unless they are really willing to downgrade protocol version
used for a response (i.e. to HTTP/0.9 if no response headers are available).
In neither case r->http_version may be upgraded.

The former code downgraded response from HTTP/1.1 to HTTP/1.0 for no reason,
causing various problems (see ticket #66).  It was also possible that
HTTP/0.9 requests were upgraded to HTTP/1.0.

14 years agoVersion bump.
Maxim Dounin [Mon, 19 Dec 2011 11:21:46 +0000 (11:21 +0000)]
Version bump.

14 years agorelease-1.1.11 tag
Maxim Dounin [Mon, 12 Dec 2011 14:18:15 +0000 (14:18 +0000)]
release-1.1.11 tag

14 years agonginx-1.1.11-RELEASE release-1.1.11
Maxim Dounin [Mon, 12 Dec 2011 14:17:49 +0000 (14:17 +0000)]
nginx-1.1.11-RELEASE

14 years agoFixed RELEASE target again.
Maxim Dounin [Mon, 12 Dec 2011 12:39:19 +0000 (12:39 +0000)]
Fixed RELEASE target again.

14 years agoFixed RELEASE target to correctly call "release" one.
Maxim Dounin [Mon, 12 Dec 2011 11:00:17 +0000 (11:00 +0000)]
Fixed RELEASE target to correctly call "release" one.

14 years agoCache: only complain on long locked entries.
Maxim Dounin [Mon, 12 Dec 2011 10:49:14 +0000 (10:49 +0000)]
Cache: only complain on long locked entries.

There have been multiple reports of cases where a real locked entry was
removed, resulting in a segmentation fault later in a worker which locked
the entry.  It looks like default inactive timeout isn't enough in real
life.

For now just ignore such locked entries, and move them to the top of the
inactive queue to allow processing of other entries.