summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
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
2015-11-11Upstream: proxy_cache_convert_head directive.Roman Arutyunyan1-0/+11
The directive toggles conversion of HEAD to GET for cacheable proxy requests. When disabled, $request_method must be added to cache key for consistency. By default, HEAD is converted to GET as before.
2015-09-21Sub filter: fixed initialization in http{} level (ticket #791).Roman Arutyunyan1-1/+2
If sub_filter directive was only specified at http{} level, sub filter internal data remained uninitialized. That would lead to a crash in runtime.
2015-09-11The HTTP/2 implementation (RFC 7240, 7241).Valentin Bartenev1-11/+13
The SPDY support is removed, as it's incompatible with the new module.
2015-09-11Fixed segfault with incorrect location nesting.Maxim Dounin1-1/+1
A configuration with a named location inside a zero-length prefix or regex location used to trigger a segmentation fault, as ngx_http_core_location() failed to properly detect if a nested location was created. Example configuration to reproduce the problem: location "" { location @foo {} } Fix is to not rely on a parent location name length, but rather check command type we are currently parsing. Identical fix is also applied to ngx_http_rewrite_if(), which used to incorrectly assume the "if" directive is on server{} level in such locations. Reported by Markus Linnala. Found with afl-fuzz.
2015-08-18Perl: prototyping behavior explicitly specified.Maxim Dounin1-0/+3
When prototyping behavior is not explicitly specified, xsubpp emits a message to stderr asking to do so (see ticket #608).
2015-08-18Perl: fixed warning about "sep" may be used uninitialized.Maxim Dounin1-9/+6
2015-08-17Win32: MSVC 2015 compatibility.Maxim Dounin2-6/+5
Resolved warnings about declarations that hide previous local declarations. Warnings about WSASocketA() being deprecated resolved by explicit use of WSASocketW() instead of WSASocket(). When compiling without IPv6 support, WinSock deprecated warnings are disabled to allow use of gethostbyname().
2015-08-17Sub filter: support of variables in the strings to replace.Dmitry Volyntsev1-28/+146
2015-08-17Sub filter: support of multiple strings to replace.Dmitry Volyntsev1-166/+247
2015-08-11Core: idle connections now closed only once on exiting.Valentin Bartenev1-0/+4
Iterating through all connections takes a lot of CPU time, especially with large number of worker connections configured. As a result nginx processes used to consume CPU time during graceful shutdown. To mitigate this we now only do a full scan for idle connections when shutdown signal is received. Transitions of connections to idle ones are now expected to be avoided if the ngx_exiting flag is set. The upstream keepalive module was modified to follow this.
2015-07-16Fixed strict aliasing warnings with old GCC versions.Ruslan Ermilov1-1/+1
2015-06-16Upstream: fixed shared upstreams on win32.Ruslan Ermilov1-12/+31
2015-06-11Moved ngx_http_parse_time() to core, renamed accordingly.Maxim Dounin4-5/+5
The function is now called ngx_parse_http_time(), and can be used by any code to parse HTTP-style date and time. In particular, it will be used for OCSP stapling. For compatibility, a macro to map ngx_http_parse_time() to the new name provided for a while.
2015-06-04Upstream keepalive: reduced diffs to the plus version of nginx.Roman Arutyunyan1-39/+42
2015-05-25Disabled SSLv3 by default (ticket #653).Maxim Dounin3-7/+5
2015-05-18Upstream hash: consistency across little/big endianness.Sergey Kandaurov1-4/+15
2015-04-22Upstream: allow multiple upstreams to use the same shared zone.Ruslan Ermilov1-42/+56