summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
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.
2014-12-09Upstream: inheritance of proxy_pass and friends (ticket #645).Maxim Dounin4-24/+12
Instead of independant inheritance of conf->upstream.upstream (proxy_pass without variables) and conf->proxy_lengths (proxy_pass with variables) we now test them both and inherit only if neither is set. Additionally, SSL context is also inherited only in this case now. Based on the patch by Alexey Radkov.
2014-12-09Proxy: the "TE" header now stripped by default (ticket #537).Maxim Dounin1-0/+2
2014-11-26Cache: send conditional requests only for cached 200/206 responses.Piotr Sikora2-3/+10
RFC7232 says: The 304 (Not Modified) status code indicates that a conditional GET or HEAD request has been received and would have resulted in a 200 (OK) response if it were not for the fact that the condition evaluated to false. which means that there is no reason to send requests with "If-None-Match" and/or "If-Modified-Since" headers for responses cached with other status codes. Also, sending conditional requests for responses cached with other status codes could result in a strange behavior, e.g. upstream server returning 304 Not Modified for cached 404 Not Found responses, etc. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-08-04SSL: loading certificate keys via ENGINE_load_private_key().Dmitrii Pichulin1-0/+61
2014-12-04Version bump.Maxim Dounin1-2/+2
2014-12-02Cache: proper wakeup of subrequests.Maxim Dounin1-2/+6
In case of a cache lock timeout and in the aio handler we now call r->write_event_handler() instead of a connection write handler, to make sure to run appropriate subrequest. Previous code failed to run inactive subrequests and hence resulted in suboptimal behaviour, see report by Yichun Zhang: http://mailman.nginx.org/pipermail/nginx-devel/2013-October/004435.html (Infinite hang claimed in the report seems impossible without 3rd party modules, as subrequests will be eventually woken up by the postpone filter.)
2014-12-02Upstream: improved subrequest logging.Maxim Dounin4-21/+45
To ensure proper logging make sure to set current_request in all event handlers, including resolve, ssl handshake, cache lock wait timer and aio read handlers. A macro ngx_http_set_log_request() introduced to simplify this.
2014-12-01Access log: restricted "log_format" to "http" level.Sergey Kandaurov1-7/+1
Specifying the "log_format" directive on levels other than "http" is deprecated since 73d37e1ccb91 (1.1.11).
2014-11-28Write filter: fixed handling of sync bufs (ticket #132).Maxim Dounin1-2/+11
2014-11-28Fixed post_action to not trigger "header already sent" alert.Maxim Dounin1-0/+4
The alert was introduced in 03ff14058272 (1.5.4), and was triggered on each post_action invocation. There is no real need to call header filters in case of post_action, so return NGX_OK from ngx_http_send_header() if r->post_action is set.
2014-11-28Typo.Maxim Dounin1-1/+1
2014-11-21SPDY: push pending data while closing a stream as with keepalive.Valentin Bartenev1-1/+51
This helps to avoid delays in sending the last chunk of data because of bad interaction between Nagle's algorithm on nginx side and delayed ACK on the client side. Delays could also be caused by TCP_CORK/TCP_NOPUSH if SPDY was working without SSL and sendfile() was used.
2014-11-20Syslog: allowed underscore symbol in tag (ticket #667).Vladimir Homutov1-2/+3
2014-11-20Resolver: fixed debug event logging.Ruslan Ermilov2-17/+23
In 954867a2f0a6, we switched to using resolver node as the timer event data. This broke debug event logging. Replaced now unused ngx_resolver_ctx_t.ident with ngx_resolver_node_t.ident so that ngx_event_ident() extracts something sensible when accessing ngx_resolver_node_t as ngx_connection_t.
2014-11-20Resolver: fixed use-after-free memory access.Ruslan Ermilov1-4/+4
In 954867a2f0a6, we switched to using resolver node as the timer event data, so make sure we do not free resolver node memory until the corresponding timer is deleted.
2014-11-19Style.Valentin Bartenev1-2/+2
2014-11-19Fixed type of sendfile() return value on Linux.Valentin Bartenev1-6/+6
There was no real problem since the amount of bytes can be sent is limited by NGX_SENDFILE_MAXSIZE to less than 2G. But that can be changed in the future
2014-08-13Moved writev() handling code to a separate function.Valentin Bartenev5-102/+60
This reduces code duplication and unifies debug logging of the writev() syscall among various send chain functions.
2014-08-13Merged conditions in the ngx_*_sendfile_chain() functions.Valentin Bartenev3-27/+10
No functional changes.
2014-08-13Moved the code for coalescing file buffers to a separate function.Valentin Bartenev5-72/+53
2014-11-19Refactored ngx_solaris_sendfilev_chain().Valentin Bartenev1-18/+7
Though ngx_solaris_sendfilev_chain() shouldn't suffer from the problem mentioned in d1bde5c3c5d2 since currently IOV_MAX on Solaris is 16, but this follows the change from 3d5717550371 in order to make the code look similar to other systems and potentially eliminates the problem in the future.
2014-10-07Introduced the ngx_output_chain_to_iovec() function.Valentin Bartenev5-318/+170
It deduplicates code of the send chain functions and uses only preallocated memory, which completely solves the problem mentioned in d1bde5c3c5d2.
2014-11-19Renamed ngx_handle_sent_chain() to ngx_chain_update_sent().Valentin Bartenev8-9/+9
No functional changes.
2014-11-18Cache: add support for Cache-Control's s-maxage response directive.Piotr Sikora1-8/+14
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-11-19Proxy: renamed and rearranged fields in proxy configuration.Roman Arutyunyan1-16/+15
No functional changes.
2014-11-19Upstream: different header lists for cached and uncached requests.Roman Arutyunyan4-106/+135
The upstream modules remove and alter a number of client headers before sending the request to upstream. This set of headers is smaller or even empty when cache is disabled. It's still possible that a request in a cache-enabled location is uncached, for example, if cache entry counter is below min_uses. In this case it's better to alter a smaller set of headers and pass more client headers to backend unchanged. One of the benefits is enabling server-side byte ranges in such requests.
2014-11-19Upstream: moved header lists to separate structures.Roman Arutyunyan4-157/+179
No functional changes.
2014-11-19Upstream: moved header initializations to separate functions.Roman Arutyunyan4-89/+82
No functional changes.
2014-11-19Scgi: do not push redundant NULL element into conf->params.Roman Arutyunyan1-7/+0
2014-11-18Cache: proxy_cache_lock_age and friends.Roman Arutyunyan8-9/+71
Once this age is reached, the cache lock is discarded and another request can acquire the lock. Requests which failed to acquire the lock are not allowed to cache the response.
2014-11-07SPDY: fixed check for too long header name or value.Valentin Bartenev1-3/+3
For further progress a new buffer must be at least two bytes larger than the remaining unparsed data. One more byte is needed for null-termination and another one for further progress. Otherwise inflate() fails with Z_BUF_ERROR.
2014-11-07SPDY: improved debug logging of inflate() calls.Valentin Bartenev1-4/+16
2014-11-17SSL: logging level of "inappropriate fallback" (ticket #662).Maxim Dounin1-0/+3
Patch by Erik Dubbelboer.
2014-11-04Upstream: support named location for X-Accel-Redirect.Toshikuni Fukaya1-9/+16
2014-10-30Upstream: add "proxy_ssl_certificate" and friends.Piotr Sikora2-0/+154
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-11-07SPDY: fixed "too long header line" logging.Maxim Dounin1-2/+1
This fixes possible one byte buffer overrun and makes sure ellipsis are always added, see 21043ce2a005.
2014-11-05Cache: removed dead store in ngx_http_file_cache_vary_header().Maxim Dounin1-1/+0
Found by Clang Static Analyzer.
2014-08-25Access log: cancel the flush timer on graceful shutdown.Valentin Bartenev1-1/+15
Previously, it could prevent a worker process from exiting for up to the configured flush timeout.
2014-08-13Events: introduced cancelable timers.Valentin Bartenev5-0/+49
2014-08-25Events: simplified cycle in ngx_event_expire_timers().Valentin Bartenev1-18/+16
2014-08-25Events: removed broken thread support from event timers.Valentin Bartenev5-55/+7
It's mostly dead code. And the idea of thread support for this task has been deprecated.
2014-10-24SSL: simplified ssl_password_file error handling.Sergey Kandaurov1-14/+3
Instead of collecting a number of the possible SSL_CTX_use_PrivateKey_file() error codes that becomes more and more difficult with the rising variety of OpenSSL versions and its derivatives, just continue with the next password. Multiple passwords in a single ssl_password_file feature was broken after recent OpenSSL changes (commit 4aac102f75b517bdb56b1bcfd0a856052d559f6e). Affected OpenSSL releases: 0.9.8zc, 1.0.0o, 1.0.1j and 1.0.2-beta3. Reported by Piotr Sikora.
2014-10-27SPDY: stop emitting multiple empty header values.Piotr Sikora1-2/+6
Previously, nginx would emit empty values in a header with multiple, NULL-separated values. This is forbidden by the SPDY specification, which requires headers to have either a single (possibly empty) value or multiple, NULL-separated non-empty values. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-10-28Version bump.Valentin Bartenev1-2/+2
2014-10-15Win32: made build-able with MinGW-w64 gcc.Kouhei Sutou1-2/+35
2014-10-27Upstream: limited next_upstream time and tries when resolving DNS.Gu Feng1-0/+8
When got multiple upstream IP addresses using DNS resolving, the number of upstreams tries and the maxinum time spent for these tries were not affected. This patch fixed it.