aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* gRPC: fixed missing state save in frame header parsing.Sergey Kandaurov2018-03-20
| | | | | Previously, frame state wasn't saved if HEADERS frame payload that begins with header fragment was not received at once.
* HTTP/2: improved frame info debugging.Ruslan Ermilov2018-03-19
|
* gRPC: fixed parsing response headers split on CONTINUATION frames.Sergey Kandaurov2018-03-19
|
* Fixed checking ngx_tcp_push() and ngx_tcp_nopush() return values.Ruslan Ermilov2018-03-19
| | | | No functional changes.
* Upstream: fixed comments after 13f8dec720b5.Ruslan Ermilov2018-03-19
| | | | | | The fields "uri", "location", and "url" from ngx_http_upstream_conf_t moved to ngx_http_proxy_loc_conf_t and ngx_http_proxy_vars_t, reflect this change in create_loc_conf comments.
* gRPC: special handling of "trailer only" responses.Maxim Dounin2018-03-17
| | | | | | | | | | | | | | | | The gRPC protocol makes a distinction between HEADERS frame with the END_STREAM flag set, and a HEADERS frame followed by an empty DATA frame with the END_STREAM flag. The latter is not permitted, and results in errors not being propagated through nginx. Instead, gRPC clients complain that "server closed the stream without sending trailers" (seen in grpc-go) or "13: Received RST_STREAM with error code 2" (seen in grpc-c). To fix this, nginx now returns HEADERS with the END_STREAM flag if the response length is known to be 0, and we are not expecting any trailer headers to be added. And the response length is explicitly set to 0 in the gRPC proxy if we see initial HEADERS frame with the END_STREAM flag set.
* gRPC: special handling of the TE request header.Maxim Dounin2018-03-17
| | | | | | | | | | | According to the gRPC protocol specification, the "TE" header is used to detect incompatible proxies, and at least grpc-c server rejects requests without "TE: trailers". To preserve the logic, we have to pass "TE: trailers" to the backend if and only if the original request contains "trailers" in the "TE" header. Note that no other TE values are allowed in HTTP/2, so we have to remove anything else.
* The gRPC proxy module.Maxim Dounin2018-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | The module allows passing requests to upstream gRPC servers. The module is built by default as long as HTTP/2 support is compiled in. Example configuration: grpc_pass 127.0.0.1:9000; Alternatively, the "grpc://" scheme can be used: grpc_pass grpc://127.0.0.1:9000; Keepalive support is available via the upstream keepalive module. Note that keepalive connections won't currently work with grpc-go as it fails to handle SETTINGS_HEADER_TABLE_SIZE. To use with SSL: grpc_pass grpcs://127.0.0.1:9000; SSL connections use ALPN "h2" when available. At least grpc-go works fine without ALPN, so if ALPN is not available we just establish a connection without it. Tested with grpc-c++ and grpc-go.
* Upstream: u->conf->preserve_output flag.Maxim Dounin2018-03-17
| | | | | | | The flag can be used to continue sending request body even after we've got a response from the backend. In particular, this is needed for gRPC proxying of bidirectional streaming RPCs, and also to send control frames in other forms of RPCs.
* Upstream: u->request_body_blocked flag.Maxim Dounin2018-03-17
| | | | | | | | The flag indicates whether last ngx_output_chain() returned NGX_AGAIN or not. If the flag is set, we arm the u->conf->send_timeout timer. The flag complements c->write->ready test, and allows to stop sending the request body in an output filter due to protocol-specific flow control.
* Upstream: trailers support, u->conf->pass_trailers flag.Maxim Dounin2018-03-17
| | | | | | | | | | Basic trailer headers support allows one to access response trailers via the $upstream_trailer_* variables. Additionally, the u->conf->pass_trailers flag was introduced. When the flag is set, trailer headers from the upstream response are passed to the client. Like normal headers, trailer headers will be hidden if present in u->conf->hide_headers_hash.
* HTTP/2: externalized various constants and interfaces.Maxim Dounin2018-03-17
|
* Style.Roman Arutyunyan2018-03-12
|
* Stream ssl_preread: $ssl_preread_alpn_protocols variable.Roman Arutyunyan2018-03-12
| | | | | The variable keeps a comma-separated list of protocol names from ALPN TLS extension defined by RFC 7301.
* Improved code readablity.Ruslan Ermilov2018-03-07
| | | | No functional changes.
* HTTP/2: unknown frames now logged at info level.Maxim Dounin2018-03-05
|
* Style.Maxim Dounin2018-03-05
|
* Access log: support for disabling escaping (ticket #1450).Vladimir Homutov2018-03-01
| | | | | Based on patches by Johannes Baiter <johannes.baiter@bsb-muenchen.de> and Calin Don.
* Core: ngx_current_msec now uses monotonic time if available.Maxim Dounin2018-03-01
| | | | | | When clock_gettime(CLOCK_MONOTONIC) (or faster variants, _FAST on FreeBSD, and _COARSE on Linux) is available, we now use it for ngx_current_msec. This should improve handling of timers if system time changes (ticket #189).
* Postpone filter: prevented uninitialized r->out.Roman Arutyunyan2018-03-01
| | | | | | The r->out chain link could be left uninitialized in case of error. A segfault could happen if the subrequest handler accessed it. The issue was introduced in commit 20f139e9ffa8.
* Generic subrequests in memory.Roman Arutyunyan2018-02-28
| | | | | | | | | | | Previously, only the upstream response body could be accessed with the NGX_HTTP_SUBREQUEST_IN_MEMORY feature. Now any response body from a subrequest can be saved in a memory buffer. It is available as a single buffer in r->out and the buffer size is configured by the subrequest_output_buffer_size directive. Upstream, proxy and fastcgi code used to handle the old-style feature is removed.
* Modules compatibility: additional upstream metrics.Vladimir Homutov2018-02-22
|
* Auth basic: prevent null character in error log (ticket #1494).Vadim Filimonov2018-02-26
|
* Generate error for unsupported IPv6 transparent proxy.Roman Arutyunyan2018-02-22
| | | | | | | | | | On some platforms (for example, Linux with glibc 2.12-2.25) IPv4 transparent proxying is available, but IPv6 transparent proxying is not. The entire feature is enabled in this case and NGX_HAVE_TRANSPARENT_PROXY macro is set to 1. Previously, an attempt to enable transparency for an IPv6 socket was silently ignored in this case and was usually followed by a bind(2) EADDRNOTAVAIL error (ticket #1487). Now the error is generated for unavailable IPv6 transparent proxy.
* HTTP/2: style.Ruslan Ermilov2018-02-22
| | | | Unified the style of validity checks in ngx_http_v2_validate_header().
* Geo: fixed indentation.Sergey Kandaurov2018-02-21
|
* Geo: optimized configuration parser.Ruslan Ermilov2018-02-21
| | | | If the geo block parser has failed, doing more things is pointless.
* Geo: fixed memory allocation error handling (closes #1482).Ruslan Ermilov2018-02-21
| | | | | | If during configuration parsing of the geo directive the memory allocation has failed, pool used to parse configuration inside the block, and sometimes the temporary pool were not destroyed.
* Version bump.Ruslan Ermilov2018-02-21
|
* HTTP/2: precalculate hash for "Cookie".Maxim Dounin2018-02-15
| | | | | | There is no need to calculate hashes of static strings at runtime. The ngx_hash() macro can be used to do it during compilation instead, similarly to how it is done in ngx_http_proxy_module.c for "Server" and "Date" headers.
* HTTP/2: fixed ngx_http_v2_push_stream() allocation error handling.Ruslan Ermilov2018-02-15
| | | | | | In particular, if a stream object allocation failed, and a client sent the PRIORITY frame for this stream, ngx_http_v2_set_dependency() could dereference a null pointer while trying to re-parent a dependency node.
* HTTP/2: push additional request headers (closes #1478).Ruslan Ermilov2018-02-15
| | | | | The Accept-Encoding, Accept-Language, and User-Agent header fields are now copied from the original request to pushed requests.
* Expose more headers with NGX_HTTP_HEADERS.Ruslan Ermilov2018-02-15
|
* Core: added a stub for additional zone configuration.Vladimir Homutov2018-02-15
|
* HTTP/2: style.Sergey Kandaurov2018-02-15
|
* HTTP/2: fixed null pointer dereference with server push.Ruslan Ermilov2018-02-09
| | | | | | | | | | r->headers_in.host can be NULL in ngx_http_v2_push_resource(). This happens when a request is terminated with 400 before the :authority or Host header is parsed, and either pushing is enabled on the server{} level or error_page 400 redirects to a location with pushes configured. Found by Coverity (CID 1429156).
* HTTP/2: fixed build with -Werror=unused-but-set-variable.Ruslan Ermilov2018-02-08
|
* HTTP/2: server push.Ruslan Ermilov2018-02-08
| | | | | | | | | | | | | | Resources to be pushed are configured with the "http2_push" directive. Also, preload links from the Link response headers, as described in https://www.w3.org/TR/preload/#server-push-http-2, can be pushed, if enabled with the "http2_push_preload" directive. Only relative URIs with absolute paths can be pushed. The number of concurrent pushes is normally limited by a client, but cannot exceed a hard limit set by the "http2_max_concurrent_pushes" directive.
* HTTP/2: changed prototypes of request pseudo-headers parsers.Ruslan Ermilov2018-02-08
| | | | No functional changes.
* Basic support of the Link response header.Ruslan Ermilov2018-02-08
|
* Dav: added error logging.Roman Arutyunyan2018-02-07
| | | | | | | | Previously, when request body was not available or was previously read in memory rather than a file, client received HTTP 500 error, but no explanation was logged in error log. This could happen, for example, if request body was read or discarded prior to error_page redirect, or if mirroring was enabled along with dav.
* HTTP/2: removed unused field from ngx_http_v2_stream_t.Sergey Kandaurov2018-02-06
|
* Upstream: removed X-Powered-By from the list of special headers.Ruslan Ermilov2018-01-30
| | | | | After 1e720b0be7ec, it's neither specially processed nor copied when redirecting with X-Accel-Redirect.
* SSL: using default server context in session remove (closes #1464).Sergey Kandaurov2018-01-30
| | | | | This fixes segfault in configurations with multiple virtual servers sharing the same port, where a non-default virtual server block misses certificate.
* HTTP/2: finalize request as bad if parsing of pseudo-headers fails.Ruslan Ermilov2018-01-30
| | | | | This is in line when the required pseudo-headers are missing, and avoids spurious zero statuses in access.log.
* HTTP/2: more style, comments, and debugging.Ruslan Ermilov2018-01-29
|
* HTTP/2: handle duplicate INITIAL_WINDOW_SIZE settings.Ruslan Ermilov2018-01-29
|
* Fixed --test-build-eventport on macOS 10.12 and later.Ruslan Ermilov2018-01-16
| | | | In macOS 10.12, CLOCK_REALTIME and clockid_t were added, but not timer_t.
* Upstream: fixed "header already sent" alerts on backend errors.Maxim Dounin2018-01-11
| | | | | | | | | | | | | | | | | | | | | Following ad3f342f14ba046c (1.9.13), it is possible that a request where header was already sent will be finalized with NGX_HTTP_BAD_GATEWAY, triggering an attempt to return additional error response and the "header already sent" alert as a result. In particular, it is trivial to reproduce the problem with a HEAD request and caching enabled. With caching enabled nginx will change HEAD to GET and will set u->pipe->downstream_error to suppress sending the response body to the client. When a backend-related error occurs (for example, proxy_read_timeout expires), ngx_http_finalize_upstream_request() will be called with NGX_HTTP_BAD_GATEWAY. After ad3f342f14ba046c this will result in ngx_http_finalize_request(NGX_HTTP_BAD_GATEWAY). Fix is to move u->pipe->downstream_error handling to a later point, where all special response codes are changed to NGX_ERROR. Reported by Jan Prachar, http://mailman.nginx.org/pipermail/nginx-devel/2018-January/010737.html.
* Version bump.Maxim Dounin2017-12-30
|