summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_uwsgi_module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-11-02Cache: proxy_cache_max_range_offset and friends.Dmitry Volyntsev1-0/+12
It configures a threshold in bytes, above which client range requests are not cached. In such a case the client's Range header is passed directly to a proxied server.
2016-10-31Upstream: added the ngx_http_upstream_resolved_t.name field.Ruslan Ermilov1-4/+2
This fixes inconsistency in what is stored in the "host" field. Normally it would contain the "host" part of the parsed URL (e.g., proxy_pass with variables), but for the case of an implicit upstream specified with literal address it contained the text representation of the socket address (that is, host including port for IP). Now the "host" field always contains the "host" part of the URL, while the text representation of the socket address is stored in the newly added "name" field. The ngx_http_upstream_create_round_robin_peer() function was modified accordingly in a way to be compatible with the code that does not know about the new "name" field. The "stream" code was similarly modified except for not adding compatibility in ngx_stream_upstream_create_round_robin_peer(). This change is also a prerequisite for the next change.
2016-10-31Upstream: removed unnecessary condition in proxy_eval() and friends.Ruslan Ermilov1-1/+1
The first condition added in d3454e719bbb should have just replaced the second one.
2016-10-14Upstream: handling of proxy_set_header at http level.Maxim Dounin1-0/+14
When headers are set at the "http" level and not redefined in a server block, we now preserve conf->headers into the "http" section configuration to inherit it to all servers. The same applies to conf->headers_cache, though it may not be effective if no servers use cache at the "server" level as conf->headers_cache is only initialized if cache is enabled on a given level. Similar changes made in fastcgi/scgi/uwsgi to preserve conf->params and conf->params_cache.
2016-06-15SSL: ngx_ssl_ciphers() to set list of ciphers.Tim Taubert1-6/+2
This patch moves various OpenSSL-specific function calls into the OpenSSL module and introduces ngx_ssl_ciphers() to make nginx more crypto-library-agnostic.
2015-12-18Upstream: the "transparent" parameter of proxy_bind and friends.Roman Arutyunyan1-1/+1
This parameter lets binding the proxy connection to a non-local address. Upstream will see the connection as coming from that address. When used with $remote_addr, upstream will accept the connection from real client address. Example: proxy_bind $remote_addr transparent;
2016-03-28Upstream: proxy_next_upstream non_idempotent.Maxim Dounin1-0/+1
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".
2015-11-21Upstream: fixed "no port" detection in evaluated upstreams.Ruslan Ermilov1-2/+3
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-05-25Disabled SSLv3 by default (ticket #653).Maxim Dounin1-3/+2
2015-03-23Upstream: uwsgi_request_buffering, scgi_request_buffering.Maxim Dounin1-1/+22
2014-12-22Upstream: added variables support to proxy_cache and friends.Valentin Bartenev1-8/+70
2014-12-22Upstream: refactored proxy_cache and friends.Valentin Bartenev1-17/+19
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 Bartenev1-0/+14
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 Bartenev1-8/+6
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-10-09Upstream: fixed inheritance of proxy_store and friends.Valentin Bartenev1-1/+1
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-09Upstream: fixed unexpected inheritance into limit_except blocks.Maxim Dounin1-6/+9
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 Dounin1-7/+5
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-11-19Upstream: different header lists for cached and uncached requests.Roman Arutyunyan1-29/+34
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 Arutyunyan1-39/+43
No functional changes.
2014-11-19Upstream: moved header initializations to separate functions.Roman Arutyunyan1-23/+21
No functional changes.
2014-11-18Cache: proxy_cache_lock_age and friends.Roman Arutyunyan1-0/+11
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-10-30Upstream: add "proxy_ssl_certificate" and friends.Piotr Sikora1-0/+73
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-10-28Upstream: proxy_limit_rate and friends.Roman Arutyunyan1-0/+11
The directives limit the upstream read rate. For example, "proxy_limit_rate 42" limits proxy upstream read rate to 42 bytes per second.
2014-10-14Upstream: proxy_force_ranges and friends.Roman Arutyunyan1-0/+11
The directives enable byte ranges for both cached and uncached responses regardless of backend headers.
2014-09-12Upstream: limited next_upstream time and tries (ticket #544).Roman Arutyunyan1-0/+22
The new directives {proxy,fastcgi,scgi,uwsgi,memcached}_next_upstream_tries and {proxy,fastcgi,scgi,uwsgi,memcached}_next_upstream_timeout limit the number of upstreams tried and the maximum time spent for these tries when searching for a valid upstream.
2014-09-11Added warning about unset cache keys.Maxim Dounin1-0/+5
In fastcgi, scgi and uwsgi modules there are no default cache keys, and using a cache without a cache key set is likely meaningless.
2014-09-11Style.Maxim Dounin1-1/+2
2014-07-08Style: remove whitespace between function name and parentheses.Piotr Sikora1-1/+1
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-06-26Upstream: cache revalidation using If-None-Match.Maxim Dounin1-1/+1
2014-04-18Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.Maxim Dounin1-0/+85
Just a merge of proxy_ssl_name, proxy_ssl_verify commits into uwsgi module, code is identical.
2014-04-18Upstream: plugged potential memory leak on reload.Maxim Dounin1-8/+8
The SSL_CTX_set_cipher_list() may fail if there are no valid ciphers specified in proxy_ssl_ciphers / uwsgi_ssl_ciphers, resulting in SSL context leak. In theory, ngx_pool_cleanup_add() may fail too, but this case is intentionally left out for now as it's almost impossible and proper fix will require changes to http ssl and mail ssl code as well.
2014-02-11Upstream: fix $upstream_status variable.Piotr Sikora1-2/+2
Previously, upstream's status code was overwritten with cached response's status code when STALE or REVALIDATED response was sent to the client. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-12-27Style: removed surplus semicolons.Valentin Bartenev1-1/+1
2013-12-12Trailing whitespace fix.Maxim Dounin1-1/+1
2013-12-06Fixed incorrect ngx_str_set() usage, broken in c82b2e020b9f.Piotr Sikora1-1/+1
Found by Coverity Scan CID 1135525. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-12-04Fixed build without SSL, broken by c82b2e020b9f.Maxim Dounin1-3/+3
2013-12-04SSL support in the uwsgi module.Maxim Dounin1-7/+197
Based on patch by Roberto De Ioris.
2013-11-29Upstream: skip empty cache headers.Maxim Dounin1-1/+1
Notably this fixes HTTP_IF_MODIFIED_SINCE which was always sent with cache enabled in fastcgi/scgi/uwsgi after 43ccaf8e8728.
2013-11-18Upstream: cache revalidation with conditional requests.Maxim Dounin1-1/+13
The following new directives are introduced: proxy_cache_revalidate, fastcgi_cache_revalidate, scgi_cache_revalidate, uwsgi_cache_revalidate. Default is off. When set to on, they enable cache revalidation using conditional requests with If-Modified-Since for expired cache items. As of now, no attempts are made to merge headers given in a 304 response during cache revalidation with headers previously stored in a cache item. Headers in a 304 response are only used to calculate new validity time of a cache item.
2013-09-27Upstream: subrequest_in_memory support for SCGI and uwsgi enabled.Maxim Dounin1-7/+0
This was missed in 9d59a8eda373 when non-buffered support was added to SCGI and uwsgi.
2013-05-27Upstream: http_403 support in proxy_next_upstream (and friends).Maxim Dounin1-0/+1
The parameter is mostly identical to http_404, and is expected to be used in similar situations. The 403 code might be returned by a backend instead of 404 on initial sync of new directories with rsync. See here for feature request and additional details: http://mailman.nginx.org/pipermail/nginx-ru/2013-April/050920.html
2013-02-23Trailing whitespace fix.Maxim Dounin1-1/+1
2013-02-20Connection upgrade support in uwsgi and scgi modules.Maxim Dounin1-1/+9
Prodded by Roberto De Ioris.
2013-01-16Fixed and improved the "*_bind" directives of proxying modules.Ruslan Ermilov1-0/+5
The "proxy_bind", "fastcgi_bind", "uwsgi_bind", "scgi_bind" and "memcached_bind" directives are now inherited; inherited value can be reset by the "off" parameter. Duplicate directives are now detected. Parameter value can now contain variables.
2012-12-06Allow the complex value to be defined as an empty string.Ruslan Ermilov1-1/+1
This makes conversion from strings to complex values possible without the loss of functionality.
2012-05-11Added r->state reset on fastcgi/scgi/uwsgi request start.Maxim Dounin1-0/+2
Failing to do so results in problems if 400 or 414 requests are redirected to fastcgi/scgi/uwsgi upstream, as well as after invalid headers got from upstream. This was already fixed for proxy in r3478, but fastcgi (the only affected protocol at that time) was missed. Reported by Matthieu Tourne.
2012-04-12Fixed grammar in error messages.Ruslan Ermilov1-6/+6
2012-03-15Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().Maxim Dounin1-2/+4
This resulted in a disclosure of previously freed memory if upstream server returned specially crafted response, potentially exposing sensitive information. Reported by Matthew Daley.
2012-03-15Uwsgi: merged r->http_version fixes from scgi module.Maxim Dounin1-12/+3
Fixed incorrect use of r->http_version (r4372). Removed duplicate function declaration (r4373). Removed error if there is no Status header (r4374).
2012-03-05Whitespace fixes.Maxim Dounin1-1/+2