summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules (follow)
AgeCommit message (Collapse)AuthorFilesLines
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
2014-12-22Upstream: refactored proxy_cache and friends.Valentin Bartenev4-74/+78
The configuration handling code has changed to look similar to the proxy_store directive and friends. This simplifies adding variable support in the following patch. No functional changes.
2014-12-22Upstream: mutually exclusive inheritance of "cache" and "store".Valentin Bartenev4-0/+56
Currently, storing and caching mechanisms cannot work together, and a configuration error is thrown when the proxy_store and proxy_cache directives (as well as their friends) are configured on the same level. But configurations like in the example below were allowed and could result in critical errors in the error log: proxy_store on; location / { proxy_cache one; } Only proxy_store worked in this case. For more predictable and errorless behavior these directives now prevent each other from being inherited from the previous level.
2014-12-22Upstream: simplified proxy_store and friends configuration code.Valentin Bartenev4-33/+24
This changes internal API related to handling of the "store" flag in ngx_http_upstream_conf_t. Previously, a non-null value of "store_lengths" was enough to enable store functionality with custom path. Now, the "store" flag is also required to be set. No functional changes.
2014-12-12Autoindex: implemented XML output format.Valentin Bartenev1-0/+105
2014-12-12Autoindex: implemented JSON output format.Valentin Bartenev1-5/+221
2014-12-12Autoindex: rendering code moved to a separate function.Valentin Bartenev1-72/+96
No functional changes.
2014-12-11Headers filter: variables support in expires (ticket #113).Maxim Dounin1-51/+125
2014-12-11Headers filter: local variables for config, no functional changes.Maxim Dounin1-27/+31
2014-10-09Upstream: fixed inheritance of proxy_store and friends.Valentin Bartenev4-4/+4
The proxy_store, fastcgi_store, scgi_store and uwsgi_store were inherited incorrectly if a directive with variables was defined, and then redefined to the "on" value, i.e. in configurations like: proxy_store /data/www$upstream_http_x_store; location / { proxy_store on; }
2014-12-09Proxy: fixed incorrect URI change due to if (ticket #86).Maxim Dounin1-1/+1
In the following configuration request was sent to a backend without URI changed to '/' due to if: location /proxy-pass-uri { proxy_pass http://127.0.0.1:8080/; set $true 1; if ($true) { # nothing } } Fix is to inherit conf->location from the location where proxy_pass was configured, much like it's done with conf->vars.
2014-12-09Upstream: fixed unexpected inheritance into limit_except blocks.Maxim Dounin4-25/+37
The proxy_pass directive and other handlers are not expected to be inherited into nested locations, but there is a special code to inherit upstream handlers into limit_except blocks, as well as a configuration into if{} blocks. This caused incorrect behaviour in configurations with nested locations and limit_except blocks, like this: location / { proxy_pass http://u; location /inner/ { # no proxy_pass here limit_except GET { # nothing } } } In such a configuration the limit_except block inside "location /inner/" unexpectedly used proxy_pass defined in "location /", while it shouldn't. Fix is to avoid inheritance of conf->upstream.upstream (and conf->proxy_lengths) into locations which don't have noname flag.