summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules (follow)
AgeCommit message (Collapse)AuthorFilesLines
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
2015-04-21Memcached: enabled ranges.Martin Mlynář1-0/+1
2015-04-21Upstream: simplified ip_hash and hash peer selection code.Ruslan Ermilov2-44/+16
Now that peers are stored as a list, the weighted and unweighted cases became nearly identical.
2015-04-20Limit req: removed check for unknown limit_req_zone.Sergey Kandaurov1-7/+0
With 48b3d5ddfb03, it's possible to specify limit_req_zone after limit_req.
2015-04-16Upstream: get rid of questionable micro-optimization in ip_hash.Ruslan Ermilov1-7/+2
If a peer was initially skipped due to max_fails, there's no reason not to try it again if enough time has passed, and the next_upstream logic is in action. This also reduces diffs with NGINX Plus.
2015-04-14Upstream: the "zone" directive.Ruslan Ermilov1-0/+213
Upstreams with the "zone" directive are kept in shared memory, with a consistent view of all worker processes.
2015-04-14Upstreams: locking.Ruslan Ermilov3-6/+31
2015-04-10Upstream: store peers as a linked list.Ruslan Ermilov3-46/+62
This is an API change.
2015-04-10Upstream: track the number of active connections to upstreams.Ruslan Ermilov3-120/+24
This also simplifies the implementation of the least_conn module.
2015-03-31Fixed invalid access to complex value defined as an empty string.Sergey Kandaurov1-3/+3
Found by Valgrind.
2015-03-26Proxy: fixed proxy_request_buffering and chunked with preread body.Maxim Dounin1-3/+4
If any preread body bytes were sent in the first chain, chunk size was incorrectly added before the whole chain, including header, resulting in an invalid request sent to upstream. Fixed to properly add chunk size after the header.
2015-03-23Upstream: uwsgi_request_buffering, scgi_request_buffering.Maxim Dounin2-2/+44
2015-03-23FastCGI: fastcgi_request_buffering.Maxim Dounin1-18/+342
2015-03-23Proxy: proxy_request_buffering chunked support.Maxim Dounin1-6/+216
2015-03-23Request body: unbuffered reading.Maxim Dounin1-1/+25
The r->request_body_no_buffering flag was introduced. It instructs client request body reading code to avoid reading the whole body, and to call post_handler early instead. The caller should use the ngx_http_read_unbuffered_request_body() function to read remaining parts of the body. Upstream module is now able to use this mode, if configured with the proxy_request_buffering directive.
2015-03-23Proxy: fixed proxy_set_body with proxy_cache.Maxim Dounin1-0/+1
If the last header evaluation resulted in an empty header, the e.skip flag was set and was not reset when we've switched to evaluation of body_values. This incorrectly resulted in body values being skipped instead of producing some correct body as set by proxy_set_body. Fix is to properly reset the e.skip flag. As the problem only appeared if the last potentially non-empty header happened to be empty, it only manifested itself if proxy_set_body was used with proxy_cache.
2015-03-23SSL: avoid SSL_CTX_set_tmp_rsa_callback() call with LibreSSL.Maxim Dounin1-0/+2
LibreSSL removed support for export ciphers and a call to SSL_CTX_set_tmp_rsa_callback() results in an error left in the error queue. This caused alerts "ignoring stale global SSL error (...called a function you should not call) while SSL handshaking" on a first connection in each worker process.
2015-03-17Overflow detection in ngx_http_range_parse().Ruslan Ermilov1-1/+12
2015-03-04Proxy: use an appropriate error on memory allocation failure.Ruslan Ermilov1-1/+1
2015-03-03Upstream keepalive: drop ready flag on EAGAIN from recv(MSG_PEEK).Valentin Bartenev1-1/+1
Keeping the ready flag in this case might results in missing notification of broken connection until nginx tried to use it again. While there, stale comment about stale event was removed since this function is also can be called directly.
2015-03-02Upstream hash: speedup consistent hash init.Roman Arutyunyan1-21/+31
Repeatedly calling ngx_http_upstream_add_chash_point() to create the points array in sorted order, is O(n^2) to the total weight. This can cause nginx startup and reconfigure to be substantially delayed. For example, when total weight is 1000, startup takes 5s on a modern laptop. Replace this with a linear insertion followed by QuickSort and duplicates removal. Startup for total weight of 1000 reduces to 40ms. Based on a patch by Wai Keen Woon.
2014-12-22Upstream: added variables support to proxy_cache and friends.Valentin Bartenev4-32/+280