aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.h
Commit message (Collapse)AuthorAge
* 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.
* Expose more headers with NGX_HTTP_HEADERS.Ruslan Ermilov2018-02-15
|
* Basic support of the Link response header.Ruslan Ermilov2018-02-08
|
* Upstream: keep request body file from removal if requested.Roman Arutyunyan2017-07-19
| | | | | | | | | | The new request flag "preserve_body" indicates that the request body file should not be removed by the upstream module because it may be used later by a subrequest. The flag is set by the SSI (ticket #585), addition and slice modules. Additionally, it is also set by the upstream module when a background cache update subrequest is started to prevent the request body file removal after an internal redirect. Only the main request is now allowed to remove the file.
* Added support for trailers in HTTP responses.Piotr Sikora2017-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | Example: ngx_table_elt_t *h; h = ngx_list_push(&r->headers_out.trailers); if (h == NULL) { return NGX_ERROR; } ngx_str_set(&h->key, "Fun"); ngx_str_set(&h->value, "with trailers"); h->hash = ngx_hash_key_lc(h->key.data, h->key.len); The code above adds "Fun: with trailers" trailer to the response. Modules that want to emit trailers must set r->expect_trailers = 1 in header filter, otherwise they might not be emitted for HTTP/1.1 responses that aren't already chunked. This change also adds $sent_trailer_* variables. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Background subrequests for cache updates.Roman Arutyunyan2017-05-25
| | | | | | | | | | Previously, cache background update might not work as expected, making client wait for it to complete before receiving the final part of a stale response. This could happen if the response could not be sent to the client socket in one filter chain call. Now background cache update is done in a background subrequest. This type of subrequest does not block any other subrequests or the main request.
* Don't pretend we support HTTP major versions >1 as HTTP/1.1.Ruslan Ermilov2017-04-25
|
* Added support for the "308 Permanent Redirect" (ticket #877).Simon Leblanc2017-04-11
|
* Added support for "429 Too Many Requests" response (RFC6585).Piotr Sikora2017-03-24
| | | | | | | | This change adds reason phrase in status line and pretty response body when "429" status code is used in "return", "limit_conn_status" and/or "limit_req_status" directives. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Converted hc->busy/hc->free to use chain links.Maxim Dounin2017-03-07
| | | | | | | | Most notably, this fixes possible buffer overflows if number of large client header buffers in a virtual server is different from the one in the default server. Reported by Daniil Bondarev.
* Upstream: proxy_cache_background_update and friends.Roman Arutyunyan2017-02-10
| | | | The directives enable cache updates in subrequests.
* Modules compatibility: compatibility with NGX_HTTP_SSL.Maxim Dounin2016-10-10
| | | | | | | With this change it is now possible to load modules compiled without the "--with-http_ssl_module" configure option into nginx binary compiled with it, and vice versa (if a module doesn't use ssl-specific functions), assuming both use the "--with-compat" option.
* Modules compatibility: http2.Maxim Dounin2016-10-03
| | | | | HTTP/2-specific fields in structures are now available unconditionally. Removed NGX_HTTP_V2 from the signature accordingly.
* Modules compatibility: status fields.Maxim Dounin2016-09-29
|
* Modules compatibility: health check fields.Maxim Dounin2016-09-29
|
* Removed influence of some options on structures.Ruslan Ermilov2016-09-20
|
* HTTP/2: the "421 Misdirected Request" response (closes #848).Valentin Bartenev2016-05-20
| | | | | | | | | | | | | | | | | | | | | | | | Since 4fbef397c753 nginx rejects with the 400 error any attempts of requesting different host over the same connection, if the relevant virtual server requires verification of a client certificate. While requesting hosts other than negotiated isn't something legal in HTTP/1.x, the HTTP/2 specification explicitly permits such requests for connection reuse and has introduced a special response code 421. According to RFC 7540 Section 9.1.2 this code can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI. And the client may retry the request over a different connection. Now this code is used for requests that aren't authorized in current connection. After receiving the 421 response a client will be able to open a new connection, provide the required certificate and retry the request. Unfortunately, not all clients currently are able to handle it well. Notably Chrome just shows an error, while at least the latest version of Firefox retries the request over a new connection.
* Dav: return 501 on PUT with ranges (ticket #948).Maxim Dounin2016-05-16
|
* HTTP/2: rewritten handling of request body.Valentin Bartenev2016-04-01
| | | | | | | | | | | | | There are two improvements: 1. Support for request body filters; 2. Receiving of request body is started only after the ngx_http_read_client_request_body() call. The last one fixes the problem when the client_max_body_size value might not be respected from the right location if the location was changed either during the process of receiving body or after the whole body had been received.
* Slice filter.Roman Arutyunyan2015-12-07
| | | | | | | | | | | | | | | | | | | | | | 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; } }
* The HTTP/2 implementation (RFC 7240, 7241).Valentin Bartenev2015-09-11
| | | | The SPDY support is removed, as it's incompatible with the new module.
* Decreased the NGX_HTTP_MAX_SUBREQUESTS limit.Valentin Bartenev2015-08-31
| | | | | There is no much sense in such a big value since its semantics has been changed in 06e850859a26 to limit recursive subrequests.
* Added protection against r->main->count overflow by subrequests.Valentin Bartenev2015-08-31
| | | | | | This overflow has become possible after the change in 06e850859a26, since concurrent subrequests are not limited now and each of them is counted in r->main->count.
* Core: the ngx_set_connection_log() macro.Vladimir Homutov2015-04-25
| | | | The http and stream versions of this macro were identical.
* Request body: unbuffered reading.Maxim Dounin2015-03-23
| | | | | | | | | | | 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.
* Style: moved ngx_http_ephemeral() macro to ngx_http_request.h.Ruslan Ermilov2015-03-04
|
* Refactored sendfile() AIO preload.Valentin Bartenev2015-02-11
| | | | | | | | This reduces layering violation and simplifies the logic of AIO preread, since it's now triggered by the send chain function itself without falling back to the copy filter. The context of AIO operation is now stored per file buffer, which makes it possible to properly handle cases when multiple buffers come from different locations, each with its own configuration.
* Upstream: improved subrequest logging.Maxim Dounin2014-12-02
| | | | | | | 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.
* Entity tags: explicit flag to skip not modified filter.Maxim Dounin2014-06-26
| | | | | | | | | | | | | | Previously, last_modified_time was tested against -1 to check if the not modified filter should be skipped. Notably, this prevented nginx from additional If-Modified-Since (et al.) checks on proxied responses. Such behaviour is suboptimal in some cases though, as checks are always skipped on responses from a cache with ETag only (without Last-Modified), resulting in If-None-Match being ignored in such cases. Additionally, it was not possible to return 412 from the If-Unmodified-Since if last modification time was not known for some reason. This change introduces explicit r->disable_not_modified flag instead, which is set by ngx_http_upstream_process_headers().
* Added syslog support for error_log and access_log directives.Vladimir Homutov2014-05-12
|
* Charset filter: fixed charset setting on encoded replies.Maxim Dounin2014-05-19
| | | | | | | | If response is gzipped we can't recode response, but in case it's not needed we still can add charset to Content-Type. The r->ignore_content_encoding is dropped accordingly, charset with gzip_static now properly works without any special flags.
* Range filter: single_range flag in request.Maxim Dounin2014-03-21
| | | | | | | | | | | | If set, it means that response body is going to be in more than one buffer, hence only range requests with a single range should be honored. The flag is now used by mp4 and cacheable upstream responses, thus allowing range requests of mp4 files with start/end, as well as range processing on a first request to a not-yet-cached files with proxy_cache. Notably this makes it possible to play mp4 files (with proxy_cache, or with mp4 module) on iOS devices, as byte-range support is required by Apple.
* Added server-side support for PROXY protocol v1 (ticket #355).Roman Arutyunyan2014-03-17
| | | | | | | | Client address specified in the PROXY protocol header is now saved in the $proxy_protocol_addr variable and can be used in the realip module. This is currently not implemented for mail.
* Core: support several "error_log" directives.Vladimir Homutov2013-06-20
| | | | | | | | | | | | When several "error_log" directives are specified in the same configuration block, logs are written to all files with a matching log level. All logs are stored in the singly-linked list that is sorted by log level in the descending order. Specific debug levels (NGX_LOG_DEBUG_HTTP,EVENT, etc.) are not supported if several "error_log" directives are specified. In this case all logs will use debug level that has largest absolute value.
* Added r->limit_rate_after.Maxim Dounin2013-05-11
| | | | | | As of now, it allows to better control bandwidth limiting from additional modules. It is also expected to be used to add variables support to the limit_rate_after directive.
* Fixed build with --with-mail_ssl_module.Maxim Dounin2013-05-11
| | | | | | | | | If nginx was compiled without --with-http_ssl_module, but with some other module which uses OpenSSL (e.g. --with-mail_ssl_module), insufficient preprocessor check resulted in build failure. The problem was introduced by e0a3714a36f8 (1.3.14). Reported by Roman Arutyunyan.
* Preliminary experimental support for SPDY draft 2.Valentin Bartenev2013-03-20
|
* Refactored ngx_http_init_request().Valentin Bartenev2013-03-07
| | | | | Now it can be used as the request object factory with minimal impact on the connection object. Therefore it was renamed to ngx_http_create_request().
* Allocate request object from its own pool.Valentin Bartenev2013-03-01
| | | | | | | | Previously, it was allocated from a connection pool and was selectively freed for an idle keepalive connection. The goal is to put coupled things in one chunk of memory, and to simplify handling of request objects.
* SNI: avoid surplus lookup of virtual server if SNI was used.Valentin Bartenev2013-02-27
|
* SSL: do not treat SSL handshake as request.Valentin Bartenev2013-02-27
| | | | | | | | | | | | | | | | | | The request object will not be created until SSL handshake is complete. This simplifies adding another connection handler that does not need request object right after handshake (e.g., SPDY). There are also a few more intentional effects: - the "client_header_buffer_size" directive will be taken from the server configuration that was negotiated by SNI; - SSL handshake errors and timeouts are not logged into access log as bad requests; - ngx_ssl_create_connection() is not called until the first byte of ClientHello message was received. This also decreases memory consumption if plain HTTP request is sent to SSL socket.
* SNI: reuse selected configuration for all requests in a connection.Valentin Bartenev2013-02-27
| | | | | | | | | | | | | | | | | | Previously, only the first request in a connection was assigned the configuration selected by SNI. All subsequent requests initially used the default server's configuration, ignoring SNI, which was wrong. Now all subsequent requests in a connection will initially use the configuration selected by SNI. This is done by storing a pointer to configuration in http connection object. It points to default server's configuration initially, but changed upon receipt of SNI. (The request's configuration can be further refined when parsing the request line and Host: header.) This change was not made specific to SNI as it also allows slightly faster access to configuration without the request object.
* Introduced the ngx_http_set_connection_log() macro.Valentin Bartenev2013-02-27
| | | | No functional changes.
* The default server lookup is now done only once per connection.Valentin Bartenev2013-02-27
| | | | Previously, it was done for every request in a connection.
* Correctly handle multiple X-Forwarded-For headers (ticket #106).Ruslan Ermilov2013-02-27
|
* Proxy: support for connection upgrade (101 Switching Protocols).Maxim Dounin2013-02-18
| | | | | | | | | | | | | | This allows to proxy WebSockets by using configuration like this: location /chat/ { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } Connection upgrade is allowed as long as it was requested by a client via the Upgrade request header.
* Request body: chunked transfer encoding support.Maxim Dounin2012-11-21
|
* Entity tags: basic support in not modified filter.Maxim Dounin2012-07-07
| | | | | | | | | | | This includes handling of ETag headers (if present in a response) with basic support for If-Match, If-None-Match conditionals in not modified filter. Note that the "r->headers_out.last_modified_time == -1" check in the not modified filter is left as is intentionally. It's to prevent handling of If-* headers in case of proxy without cache (much like currently done with If-Modified-Since).
* Fixed compile-time conditionals used to detect if X-Forwarded-For supportRuslan Ermilov2012-06-21
| | | | is needed.
* Raised simultaneous subrequest limit from 50 to 200.Maxim Dounin2012-02-28
| | | | | | It wasn't enforced for a long time, and there are reports that people use up to 100 simultaneous subrequests now. As this is a safety limit to prevent loops, it's raised accordingly.