summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-10-06Realip: fixed duplicate processing on redirects (ticket #1098).Maxim Dounin1-4/+4
Duplicate processing was possible if the address set by realip was listed in set_realip_from, and there was an internal redirect so module context was cleared. This resulted in exactly the same address being set, so this wasn't a problem before the $realip_remote_addr variable was introduced, though now results in incorrect $realip_remote_addr being picked. Fix is to use ngx_http_realip_get_module_ctx() to look up module context even if it was cleared. Additionally, the order of checks was switched to check the configuration first as it looks more effective.
2016-10-03Addition filter: set last_in_chain flag when clearing last_buf.Roman Arutyunyan1-0/+1
When the last_buf flag is cleared for add_after_body to append more data from a subrequest, other filters may still have buffered data, which should be flushed at this point. For example, the sub_filter may have a partial match buffered, which will only be flushed after the subrequest is done, ending up with interleaved data in output. Setting last_in_chain instead of last_buf flushes the data and fixes the order of output buffers.
2016-10-03Do not set last_buf flag in subrequests.Roman Arutyunyan2-2/+3
The last_buf flag should only be set in the last buffer of the main request. Otherwise, several last_buf flags can appear in output. This can, for example, break the chunked filter, which will include several final chunks in output.
2016-09-22Upstream: max_conns.Ruslan Ermilov3-0/+23
2016-09-22Upstream: removed the quick recovery mechanism.Ruslan Ermilov1-6/+0
Its usefulness it questionable, and it interacts badly with max_conns.
2016-09-22Upstream: style.Maxim Dounin2-2/+0
2016-09-20Perl: pass additional linker options to perl module.Konstantin Pavlov1-0/+2
Previously flags passed by --with-ld-opt were not used when building perl module, which meant hardening flags provided by package build systems were not applied.
2016-09-16Upstream hash: fixed missing upstream name initialization.Vladimir Homutov1-0/+1
2016-09-01Realip: fixed uninitialized memory access.Roman Arutyunyan1-1/+1
Previously, the realip module could be left with uninitialized context after an error in the ngx_http_realip_set_addr() function. That context could be later accessed by $realip_remote_addr and $realip_remote_port variable handlers.
2016-08-25Geo: fixed indentation.Sergey Kandaurov1-5/+5
2016-08-23Geo: fixed warnings when removing nonexistent ranges.Ruslan Ermilov1-7/+3
geo $geo { ranges; 10.0.0.0-10.0.0.255 test; delete 10.0.1.0-10.0.1.255; # should warn delete 10.0.0.0-10.0.0.255; delete 10.0.0.0-10.0.0.255; # should warn }
2016-08-23Geo: fixed insertion of ranges specified in descending order.Ruslan Ermilov1-3/+8
2016-08-23Geo: fixed removing a range in certain cases.Ruslan Ermilov1-1/+1
If the range includes two or more /16 networks and does not start at the /16 boundary, the last subrange was not removed (see 91cff7f97a50 for details).
2016-08-23Geo: fixed overflow when iterating over ranges.Ruslan Ermilov1-2/+10
2016-08-18Geo: fixed access to already freed memory.Valentin Bartenev1-1/+6
Previously, in "ranges" mode when all added ranges were deleted, the ctx.high.low[i] was left pointing to a temporary array.
2016-08-08Simplified extraction of current time.Ruslan Ermilov2-16/+8
2016-07-07Avoid left-shifting integers into the sign bit, which is undefined.Sergey Kandaurov2-3/+3
Found with UndefinedBehaviorSanitizer.
2016-07-02Sub filter: eliminate unnecessary buffering.Roman Arutyunyan1-4/+37
Previously, when a buffer was processed by the sub filter, its final bytes could be buffered by the filter even if they don't match any pattern. This happened because the Boyer-Moore algorithm, employed by the sub filter since b9447fc457b4 (1.9.4), matches the last characters of patterns prior to checking other characters. If the last character is out of scope, initial bytes of a potential match are buffered until the last character is available. Now, after receiving a flush or recycled buffer, the filter performs additional checks to reduce the number of buffered bytes. The potential match is checked against the initial parts of all patterns. Non-matching bytes are not buffered. This improves processing of a chunked response from upstream by sending the entire chunks without buffering unless a partial match is found at the end of a chunk.
2016-07-02Sub filter: introduced the ngx_http_sub_match() function.Roman Arutyunyan1-31/+52
No functional changes.
2016-06-20Introduced ngx_inet_get_port() and ngx_inet_set_port() functions.Roman Arutyunyan1-37/+2
2016-06-15SSL: ngx_ssl_ciphers() to set list of ciphers.Tim Taubert3-27/+7
This patch moves various OpenSSL-specific function calls into the OpenSSL module and introduces ngx_ssl_ciphers() to make nginx more crypto-library-agnostic.
2016-05-23Realip: detect duplicate real_ip_header directive.Ruslan Ermilov1-0/+4
2016-05-23Realip: take client port from PROXY protocol header.Dmitry Volyntsev1-0/+22
Previously, when the client address was changed to the one from the PROXY protocol header, the client port ($remote_port) was reset to zero. Now the client port is also changed to the one from the PROXY protocol header.
2016-05-23Added the $realip_remote_port variable.Dmitry Volyntsev1-4/+71
2016-05-23Introduced the ngx_sockaddr_t type.Ruslan Ermilov1-1/+1
It's properly aligned and can hold any supported sockaddr.
2016-05-19SSL: support for multiple curves (ticket #885).Maxim Dounin1-1/+1
OpenSSL 1.0.2+ allows configuring a curve list instead of a single curve previously supported. This allows use of different curves depending on what client supports (as available via the elliptic_curves extension), and also allows use of different curves in an ECDHE key exchange and in the ECDSA certificate. The special value "auto" was introduced (now the default for ssl_ecdh_curve), which means "use an internal list of curves as available in the OpenSSL library used". For versions prior to OpenSSL 1.0.2 it maps to "prime256v1" as previously used. The default in 1.0.2b+ prefers prime256v1 as well (and X25519 in OpenSSL 1.1.0+). As client vs. server preference of curves is controlled by the same option as used for ciphers (SSL_OP_CIPHER_SERVER_PREFERENCE), the ssl_prefer_server_ciphers directive now controls both.
2016-05-19SSL: support for multiple certificates (ticket #814).Maxim Dounin2-17/+34
2016-05-16Dav: return 501 on PUT with ranges (ticket #948).Maxim Dounin1-0/+6
2016-05-12Map: support of complex values in resulting strings.Dmitry Volyntsev1-59/+67
2015-12-18Upstream: the "transparent" parameter of proxy_bind and friends.Roman Arutyunyan5-5/+5
This parameter lets binding the proxy connection to a non-local address. Upstream will see the connection as coming from that address. When used with $remote_addr, upstream will accept the connection from real client address. Example: proxy_bind $remote_addr transparent;
2016-04-11FastCGI: skip special bufs in buffered request body chain.Valentin Bartenev1-0/+5
This prevents forming empty records out of such buffers. Particularly it fixes double end-of-stream records with chunked transfer encoding, or when HTTP/2 is used and the END_STREAM flag has been sent without data. In both cases there is an empty buffer at the end of the request body chain with the "last_buf" flag set. The canonical libfcgi, as well as php implementation, tolerates such records, while the HHVM parser is more strict and drops the connection (ticket #950).
2016-04-11Fixed typos.Alessandro Ghedini1-2/+2
2016-04-07Fixed spelling.Josh Soref2-5/+5
2016-03-31SSL: RSA_generate_key() is deprecated in OpenSSL 1.1.0.Maxim Dounin1-1/+1
OpenSSL removed support for all 40 and 56 bit ciphers.
2016-03-31Fixed logging.Sergey Kandaurov14-25/+25
2016-03-31Fixed logging with variable field width.Sergey Kandaurov2-4/+5
2016-03-31Fixed logging in close error handling.Sergey Kandaurov1-1/+1
2016-03-30Style.Ruslan Ermilov11-28/+28
2016-03-28Upstream: proxy_next_upstream non_idempotent.Maxim Dounin4-0/+4
By default, requests with non-idempotent methods (POST, LOCK, PATCH) are no longer retried in case of errors if a request was already sent to a backend. Previous behaviour can be restored by using "proxy_next_upstream ... non_idempotent".
2016-03-28Sub filter: fixed allocation alignment.Roman Arutyunyan1-4/+4
2016-02-18Headers filter: fixed "add_header ... '' always".Ruslan Ermilov1-8/+8
The "always" parameter was ignored if the header value was empty.
2016-02-04Dynamic modules: changed ngx_modules to cycle->modules.Maxim Dounin1-4/+4
2015-12-17Upstream: don't keep connections on early responses (ticket #669).Maxim Dounin1-0/+4
2015-12-08Slice filter: terminate first slice with last_in_chain flag.Roman Arutyunyan1-0/+1
This flag makes sub filter flush buffered data and optimizes allocation in copy filter.
2015-12-08Slice filter: never run subrequests when main request is buffered.Roman Arutyunyan1-0/+4
With main request buffered, it's possible, that a slice subrequest will send output before it. For example, while main request is waiting for aio read to complete, a slice subrequest can start an aio operation as well. The order in which aio callbacks are called is undetermined.
2015-12-07Slice filter.Roman Arutyunyan2-5/+544
Splits a request into subrequests, each providing a specific range of response. The variable "$slice_range" must be used to set subrequest range and proper cache key. The directive "slice" sets slice size. The following example splits requests into 1-megabyte cacheable subrequests. server { listen 8000; location / { slice 1m; proxy_cache cache; proxy_cache_key $uri$is_args$args$slice_range; proxy_set_header Range $slice_range; proxy_cache_valid 200 206 1h; proxy_pass http://127.0.0.1:9000; } }
2015-11-06Proxy: improved code readability.Ruslan Ermilov1-12/+5
Do not assume that space character follows the method name, just pass it explicitly. The fuss around it has already proved to be unsafe, see bbdb172f0927 and http://mailman.nginx.org/pipermail/nginx-ru/2013-January/049692.html for details.
2015-11-06Style: unified request method checks.Ruslan Ermilov3-3/+3
2015-11-21Upstream: fixed "no port" detection in evaluated upstreams.Ruslan Ermilov4-8/+12
If an upstream with variables evaluated to address without a port, then instead of a "no port in upstream" error an attempt was made to connect() which failed with EADDRNOTAVAIL.
2015-11-16Realip: the $realip_remote_addr variable.Ruslan Ermilov1-1/+71