aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_proxy_module.c
Commit message (Collapse)AuthorAge
...
* Win32: Borland C compatibility fixes.Maxim Dounin2013-09-04
| | | | | | | | | | Several false positive warnings silenced, notably W8012 "Comparing signed and unsigned" (due to u_short values promoted to int), and W8072 "Suspicious pointer arithmetic" (due to large type values added to pointers). With this patch, it's now again possible to compile nginx using bcc32, with options we normally compile on win32 minus ipv6 and ssl.
* Upstream: added check if a response is complete.Maxim Dounin2013-07-25
| | | | | | | | | | | | Checks were added to both buffered and unbuffered code paths to detect and complain if a response is incomplete. Appropriate error codes are now passed to ngx_http_upstream_finalize_request(). With this change in unbuffered mode we now use u->length set to -1 as an indicator that EOF is allowed per protocol and used to indicate response end (much like its with p->length in buffered mode). Proxy module was changed to set u->length to 1 (instead of previously used -1) in case of chunked transfer encoding used to comply with the above.
* Upstream: http_403 support in proxy_next_upstream (and friends).Maxim Dounin2013-05-27
| | | | | | | | | 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
* Proxy: clear script engine used to calculate lengths.Maxim Dounin2013-05-15
| | | | | Previous code is believed to be safe, but might access uninitialized memory (e.g., e->quote).
* Proxy: $proxy_internal_body_length fixed.Maxim Dounin2013-05-11
| | | | | | | | The $proxy_internal_body_length value might change during request lifetime, notably if proxy_set_body used, and use of a cached value might result in incorrect upstream requests. Patch by Lanshun Zhou.
* Proxy: allocate $proxy_internal_body_length from request pool.Ruslan Ermilov2013-04-29
|
* 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.
* Proxy: fixed proxy_method to always add space.Maxim Dounin2013-01-22
| | | | | | Before the patch if proxy_method was specified at http{} level the code to add trailing space wasn't executed, resulting in incorrect requests to upstream.
* Fixed and improved the "*_bind" directives of proxying modules.Ruslan Ermilov2013-01-16
| | | | | | | 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.
* Proxy: better error message about unexpected data.Maxim Dounin2012-12-13
| | | | Requested by Igor Sysoev.
* Allow the complex value to be defined as an empty string.Ruslan Ermilov2012-12-06
| | | | | This makes conversion from strings to complex values possible without the loss of functionality.
* Request body: always use calculated size of a request body in proxy.Maxim Dounin2012-11-21
| | | | | This allows to handle requests with chunked body, and also simplifies handling of various request body modifications.
* Request body: chunked parsing moved to ngx_http_parse.c from proxy.Maxim Dounin2012-11-21
| | | | No functional changes.
* Proxy: added ctx checking to input filters.Maxim Dounin2012-04-23
| | | | | | The proxy module context may be NULL in case of filter finalization (e.g. by image_filter) followed by an internal redirect. This needs some better handling, but for now just check if ctx is still here.
* Fixed grammar in error messages.Ruslan Ermilov2012-04-12
|
* Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().Maxim Dounin2012-03-15
| | | | | | | | This resulted in a disclosure of previously freed memory if upstream server returned specially crafted response, potentially exposing sensitive information. Reported by Matthew Daley.
* Fixed spelling in single-line comments.Ruslan Ermilov2012-02-28
|
* Proxy: added the "proxy_cookie_path" directive.Valentin Bartenev2012-02-13
|
* Proxy: added the "proxy_cookie_domain" directive.Valentin Bartenev2012-02-13
|
* Proxy: generic regex related code from the "proxy_redirect" directive movedValentin Bartenev2012-02-13
| | | | | | to a separate function. No functional changes.
* Proxy: generic rewrite code from the "proxy_redirect" handlers moved to aValentin Bartenev2012-02-13
| | | | | | separate function with trivial optimization. No functional changes.
* Proxy: renamed some "proxy_redirect" related declarations to a more general andValentin Bartenev2012-02-13
| | | | | | reusable. No functional changes.
* Fixed proxy_redirect off inheritance.Valentin Bartenev2012-01-30
| | | | | | | | | | | | | | | | | | | Example configuration to reproduce: server { proxy_redirect off; location / { proxy_pass http://localhost:8000; proxy_redirect http://localhost:8000/ /; location ~ \.php$ { proxy_pass http://localhost:8000; # proxy_redirect must be inherited from the level above, # but instead it was switched off here } } }
* Copyright updated.Maxim Konovalov2012-01-18
|
* Fixed proxy_cache_use_stale in "no live upstreams" case.Maxim Dounin2012-01-16
|
* Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive.Maxim Dounin2012-01-11
| | | | | | Support for TLSv1.1 and TLSv1.2 protocols was introduced in OpenSSL 1.0.1 (-beta1 was recently released). This change makes it possible to disable these protocols and/or enable them without other protocols.
* Fixed: proxy_redirect with regex might broke Refresh header.Valentin Bartenev2012-01-10
| | | | | The problem was localized in ngx_http_proxy_rewrite_redirect_regex() handler function which did not take into account prefix when overwriting header value.
* Cache locks initial implementation.Maxim Dounin2011-12-26
| | | | | | | | | | | | | | | | | | | | | | New directives: proxy_cache_lock on/off, proxy_cache_lock_timeout. With proxy_cache_lock set to on, only one request will be allowed to go to upstream for a particular cache item. Others will wait for a response to appear in cache (or cache lock released) up to proxy_cache_lock_timeout. Waiting requests will recheck if they have cached response ready (or are allowed to run) every 500ms. Note: we intentionally don't intercept NGX_DECLINED possibly returned by ngx_http_file_cache_read(). This needs more work (possibly safe, but needs further investigation). Anyway, it's exceptional situation. Note: probably there should be a way to disable caching of responses if there is already one request fetching resource to cache (without waiting at all). Two possible ways include another cache lock option ("no_cache") or using proxy_no_cache with some supplied variable. Note: probably there should be a way to lock updating requests as well. For now "proxy_cache_use_stale updating" is available.
* Proxy: made proxy_pass with variables more consistent.Maxim Dounin2011-12-23
| | | | | | | | | If proxy_pass was used with variables and there was no URI component, nginx always used unparsed URI. This isn't consistent with "no variables" case, where e.g. rewrites are applied even if there is no URI component. Fix is to use the same logic in both cases, i.e. only use unparsed URI if it's valid and request is the main one.
* Proxy: added variables and regexp support to the first parameter ofValentin Bartenev2011-12-12
| | | | the "proxy_redirect" directive.
* Fixed Upgrade header clearing with proxy_cache.Maxim Dounin2011-11-14
| | | | This was missed in proxy HTTP/1.1 support commit (r4127).
* Fixed proxy_set_header inheritance with proxy_set_body.Maxim Dounin2011-11-14
|
* Fixed proxy_set_header inheritance with proxy_cache (ticket #45).Maxim Dounin2011-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | Headers cleared with cache enabled (If-Modified-Since etc.) might be cleared in unrelated servers/locations without proxy_cache enabled if proxy_cache was used in some server/location. Example config which triggered the problem: proxy_set_header X-Test "test"; server { location /1 { proxy_cache name; proxy_pass ... } } server { location /2 { proxy_pass ... } } Another one: server { proxy_cache name; location /1 { proxy_pass ... } location /2 { proxy_cache off; proxy_pass ... } } In both cases If-Modified-Since header wasn't sent to backend in location /2. Fix is to not modify conf->headers_source, but instead merge user-supplied headers from conf->headers_source and default headers (either cache or not) into separate headers_merged array.
* Wording fix, "many data" is incorrect.Maxim Dounin2011-10-12
| | | | Noted by Piotr Sikora.
* Proxy: logging levels tuned, double logging fixed.Maxim Dounin2011-09-25
|
* Proxy: whitespaces after chunk size allowed.Maxim Dounin2011-09-25
| | | | | Whitespaces after chunk size seems to be be allowed by the "implied *LWS" rule and emitted by some servers.
* Proxy: basic HTTP/1.1 support (including keepalive).Maxim Dounin2011-09-15
| | | | | By default we still send requests using HTTP/1.0. This may be changed with new proxy_http_version directive.
* Protocol version parsing in ngx_http_parse_status_line().Maxim Dounin2011-09-15
| | | | | Once we know protocol version, set u->headers_in.connection_close to indicate implicitly assumed connection close with HTTP before 1.1.
* Fixing proxy_set_body and proxy_pass_request_body with SSL.Maxim Dounin2011-08-18
| | | | | | | | | Flush flag wasn't set in constructed buffer and this prevented any data from being actually sent to upstream due to SSL buffering. Make sure we always set flush in the last buffer we are going to sent. See here for report: http://nginx.org/pipermail/nginx-ru/2011-June/041552.html
* test length of proxy_pass with variablesIgor Sysoev2011-07-30
| | | | patch by Lanshun Zhou
* update r3945 with more descriptive error messageIgor Sysoev2011-07-29
|
* always test proxy_redirect with slash, this fixes a case when nginx usesIgor Sysoev2011-02-17
| | | | | | proxy_pass "http://www", upstream redirects to "http://www.host/uri", and nginx rewrites it as ".host/uri" patch by Maxim Dounin
* *) make code consistent to fastcgi, etcIgor Sysoev2010-08-03
| | | | *) remove STUB comment
* use NULL instead of 0Igor Sysoev2010-08-03
|
* inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass insideIgor Sysoev2010-08-03
| | | | a limit_except block if no handler was defined for the block
* fix directive typeIgor Sysoev2010-08-02
|
* add warnings for proxy_no_cache and fastcgi_no_cacheIgor Sysoev2010-07-19
|
* proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypassIgor Sysoev2010-07-19
|
* use ngx_http_test_predicates(), ngx_http_set_predicate_slot()Igor Sysoev2010-07-14
| | | | delete ngx_http_cache(), ngx_http_no_cache_set_slot()