aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Win32: uris with ":$" are now rejected.Maxim Dounin2012-06-05
| | | | | | | | | There are too many problems with special NTFS streams, notably "::$data", "::$index_allocation" and ":$i30:$index_allocation". For now we don't reject all URIs with ":" like Apache does as there are no good reasons seen yet, and there are multiple programs using it in URLs (e.g. MediaWiki).
* Win32: normalization of trailing dot inside uri.Maxim Dounin2012-06-05
| | | | | | | Windows treats "/directory./" identical to "/directory/". Do the same when working on Windows. Note that the behaviour is different from one with last path component (where multiple spaces and dots are ignored by Windows).
* Win32: disallowed access to various non-canonical name variants.Maxim Dounin2012-06-05
| | | | | | This includes trailings dots and spaces, NTFS streams (and short names, as previously checked). The checks are now also done in ngx_file_info(), thus allowing to use the "try_files" directive to protect external scripts.
* Support for IPv6 literals and an optional port in resolver.Ruslan Ermilov2012-06-04
|
* Support for IPv6 literals in proxy_pass and so on.Maxim Dounin2012-06-04
|
* Upstream: least_conn compilation fixes.Maxim Dounin2012-06-04
| | | | | | Removed duplicate call of ngx_http_upstream_init_round_robin_peer() overlooked during code changes. Rewritten "return lcp->free_rr_peer(...)" as MSVC doesn't like it.
* Upstream: weights support in ip_hash balancer.Maxim Dounin2012-06-03
|
* Upstream: least_conn balancer module.Maxim Dounin2012-06-03
|
* Resolver: fixed format specification.Maxim Dounin2012-06-03
| | | | Patch by Yichun Zhang (agentzh).
* Code reduction (no functional changes).Ruslan Ermilov2012-06-01
|
* Removed mistaken setting of NGX_SSL_BUFFERED flag in ngx_ssl_send_chain()Valentin Bartenev2012-05-30
| | | | if SSL buffer is not used.
* Fixed returned value handling from the cookie rewrite handler.Valentin Bartenev2012-05-30
| | | | | | | | | | If the "proxy_cookie_domain" or "proxy_cookie_path" directive is used and there are no matches in Set-Cookie header then ngx_http_proxy_rewrite_cookie() returns NGX_DECLINED to indicate that the header was not rewritten. Returning this value further from the upstream headers copy handler resulted in 500 error response. See here for report: http://mailman.nginx.org/pipermail/nginx/2012-May/033858.html
* geoip: got rid of ugly casts when calling ngx_free().Ruslan Ermilov2012-05-29
| | | | | This is done by removing the "const" qualifier from the common return type of handler functions returning either "const char *" or "char *".
* Fixed broken build.Ruslan Ermilov2012-05-28
|
* Fixed memory leak if $geoip_org variable was used.Ruslan Ermilov2012-05-28
| | | | Patch by Denis F. Latypoff (slightly modified).
* Fixed the reuse of parsed DTDs and XSLTs.Ruslan Ermilov2012-05-24
| | | | Patch by Kuramoto Eiji.
* Fixed compilation with -DNGX_DEBUG_MALLOC on FreeBSD 10.Maxim Dounin2012-05-23
| | | | | After jemalloc 3.0.0 import there is no _malloc_options symbol, it has been replaced with the malloc_conf one with a different syntax.
* Fixed warning during nginx.xs compilation.Maxim Dounin2012-05-23
|
* Fixed potential null pointer dereference in ngx_resolver_create().Ruslan Ermilov2012-05-22
| | | | While here, improved error message.
* Removed historical and now redundant syntax pre-checks in ngx_parse_url().Ruslan Ermilov2012-05-21
|
* Fixed core variables dynamic access after reconfiguration.Maxim Dounin2012-05-17
| | | | | | | | If variable was indexed in previous configuration but not in current one, the NGX_HTTP_VAR_INDEXED flag was left set and confused ngx_http_get_variable(). Patch by Yichun Zhang (agentzh), slightly modified.
* Fixed segfault with filter_finalize introduced in r4621 (1.3.0).Maxim Dounin2012-05-17
| | | | | | | | | | | | | | | | | | Example configuration to reproduce: location /image/ { error_page 415 = /zero; image_filter crop 100 100; proxy_pass http://127.0.0.1:8080; proxy_store on; } location /zero { return 204; } The problem appeared if upstream returned (big enough) non-image file, causing 415 to be generated by image filter.
* Fixed the ngx_regex.h header file compatibility with C++.Valentin Bartenev2012-05-17
|
* Zero padded the returned and logged HTTP status code, and fixed possibleRuslan Ermilov2012-05-16
| | | | buffer overrun in $status handling.
* Capped the status code that may be returned with "return" and "try_files".Ruslan Ermilov2012-05-16
|
* Added syntax checking of the second parameter of the "split_clients" directive.Ruslan Ermilov2012-05-16
|
* Version bump.Ruslan Ermilov2012-05-16
|
* Fixed win32 build after changes in r4624.Ruslan Ermilov2012-05-15
|
* Update c->sent in ngx_ssl_send_chain() even if SSL buffer is not used.Valentin Bartenev2012-05-14
|
* Reverted previous attempt to fix complation warning introduced inRuslan Ermilov2012-05-14
| | | | r4624 and actually fixed it.
* geoip: trusted proxies support and partial IPv6 support.Ruslan Ermilov2012-05-14
| | | | | | | | | | | | | | | The module now supports recursive search of client address through the chain of trusted proxies (closes #100), in the same scope as the geo module. Proxies are listed by the "geoip_proxy" directive, recursive search is enabled by the "geoip_proxy_recursive" directive. IPv6 is partially supported: proxies may be specified with IPv6 addresses. Example: geoip_country .../GeoIP.dat; geoip_proxy 127.0.0.1; geoip_proxy ::1; geoip_proxy 10.0.0.0/8; geoip_proxy_recursive on;
* geo: chains of trusted proxies and partial IPv6 support.Ruslan Ermilov2012-05-14
| | | | | | | | | | | | | | | | | | | | | | The module now supports recursive search of client address through the chain of trusted proxies, controlled by the "proxy_recursive" directive in the "geo" block. It also gets partial IPv6 support: now proxies may be specified with IPv6 addresses. Example: geo $test { ... proxy 127.0.0.1; proxy ::1; proxy_recursive; } There's also a slight change in behavior. When original client address (as specified by the "geo" directive) is one of the trusted proxies, and the value of the X-Forwarded-For request header cannot not be parsed as a valid address, an original client address will be used for lookup. Previously, 255.255.255.255 was used in this case.
* Fixed compilation warning introduced in r4624.Ruslan Ermilov2012-05-14
|
* realip: chains of trusted proxies and IPv6 support.Ruslan Ermilov2012-05-14
| | | | | | | | | | | | | | The module now supports recursive search of client address through the chain of trusted proxies, controlled by the "real_ip_recursive" directive (closes #2). It also gets full IPv6 support (closes #44) and canonical value of the $client_addr variable on address change. Example: real_ip_header X-Forwarded-For; set_real_ip_from 127.0.0.0/8; set_real_ip_from ::1; set_real_ip_from unix:; real_ip_recursive on;
* New function ngx_http_get_forwarded_addr() to look up real client address.Ruslan Ermilov2012-05-14
| | | | | | | | On input it takes an original address, string in the X-Forwarded-For format and its length, list of trusted proxies, and a flag indicating to perform the recursive search. On output it returns NGX_OK and the "deepest" valid address in a chain, or NGX_DECLINED. It supports AF_INET and AF_INET6. Additionally, original address and/or proxy may be specified as AF_UNIX.
* Upstream: fixed ip_hash rebalancing with the "down" flag.Maxim Dounin2012-05-14
| | | | | | | | | | | | Due to weight being set to 0 for down peers, order of peers after sorting wasn't the same as without the "down" flag (with down peers at the end), resulting in client rebalancing for clients on other servers. The only rebalancing which should happen after adding "down" to a server is one for clients on the server. The problem was introduced in r1377 (which fixed endless loop by setting weight to 0 for down servers). The loop is no longer possible with new smooth algorithm, so preserving original weight is safe.
* Upstream: smooth weighted round-robin balancing.Maxim Dounin2012-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For edge case weights like { 5, 1, 1 } we now produce { a, a, b, a, c, a, a } sequence instead of { c, b, a, a, a, a, a } produced previously. Algorithm is as follows: on each peer selection we increase current_weight of each eligible peer by its weight, select peer with greatest current_weight and reduce its current_weight by total number of weight points distributed among peers. In case of { 5, 1, 1 } weights this gives the following sequence of current_weight's: a b c 0 0 0 (initial state) 5 1 1 (a selected) -2 1 1 3 2 2 (a selected) -4 2 2 1 3 3 (b selected) 1 -4 3 6 -3 4 (a selected) -1 -3 4 4 -2 5 (c selected) 4 -2 -2 9 -1 -1 (a selected) 2 -1 -1 7 0 0 (a selected) 0 0 0 To preserve weight reduction in case of failures the effective_weight variable was introduced, which usually matches peer's weight, but is reduced temporarily on peer failures. This change also fixes loop with backup servers and proxy_next_upstream http_404 (ticket #47), and skipping alive upstreams in some cases if there are multiple dead ones (ticket #64).
* Fixed possible request hang with filter finalization.Maxim Dounin2012-05-14
| | | | | | | | | | | | With r->filter_finalize set the ngx_http_finalize_connection() wasn't called from ngx_http_finalize_request() called with NGX_OK, resulting in r->main->count not being decremented, thus causing request hang in some rare situations. See here for more details: http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002190.html Patch by Yichun Zhang (agentzh).
* Resolver: protection from duplicate responses.Maxim Dounin2012-05-14
| | | | | | | | | If we already had CNAME in resolver node (i.e. rn->cnlen and rn->u.cname set), and got additional response with A record, it resulted in rn->cnlen set and rn->u.cname overwritten by rn->u.addr (or rn->u.addrs), causing segmentation fault later in ngx_resolver_free_node() on an attempt to free overwritten rn->u.cname. The opposite (i.e. CNAME got after A) might cause similar problems as well.
* Accept moderation in case of EMFILE/ENFILE.Maxim Dounin2012-05-11
| | | | | | | | | | | | | | | In case of EMFILE/ENFILE returned from accept() we disable accept events, and (in case of no accept mutex used) arm timer to re-enable them later. With accept mutex we just drop it, and rely on normal accept mutex handling to re-enable accept events once it's acquired again. As we now handle errors in question, logging level was changed to "crit" (instead of "alert" used for unknown errors). Note: the code might call ngx_enable_accept_events() multiple times if there are many listen sockets. The ngx_enable_accept_events() function was modified to check if connection is already active (via c->read->active) and skip it then, thus making multiple calls safe.
* Rewrite: fixed escaping and possible segfault (ticket #162).Maxim Dounin2012-05-11
| | | | | | | | | | | | | | | | | | The following code resulted in incorrect escaping of uri and possible segfault: location / { rewrite ^(.*) $1?c=$1; return 200 "$uri"; } If there were arguments in a rewrite's replacement string, and length was actually calculated (due to duplicate captures as in the example above, or variables present), the is_args flag was set and incorrectly copied after length calculation. This resulted in escaping applied to the uri part of the replacement, resulting in incorrect escaping. Additionally, buffer was allocated without escaping expected, thus this also resulted in buffer overrun and possible segfault.
* Fastcgi: fixed padding handling on fixed-size records.Maxim Dounin2012-05-11
| | | | | | | | Padding was incorrectly ignored on end request, empty stdout and stderr fastcgi records. This resulted in protocol desynchronization if fastcgi application used these records with padding for some reason. Reported by Ilia Vinokurov.
* Added r->state reset on fastcgi/scgi/uwsgi request start.Maxim Dounin2012-05-11
| | | | | | | | | 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.
* Added write event handler reset in ngx_http_named_location().Maxim Dounin2012-05-04
| | | | | | | | | On internal redirects this happens via ngx_http_handler() call, which is not called on named location redirect. As a result incorrect write handler remained (if previously set) and this might cause incorrect behaviour (likely request hang). Patch by Yichun Zhang (agentzh).
* debug_connection: added the IPv6 and UNIX-domain socket support.Ruslan Ermilov2012-04-29
|
* Removed surplus condition.Valentin Bartenev2012-04-27
|
* Allows particular modules to handle subrequests properly.Andrey Belov2012-04-26
|
* Fixed segmentation fault in ngx_resolver_create_name_query().Ruslan Ermilov2012-04-26
| | | | | | | | | If name passed for resolution was { 0, NULL } (e.g. as a result of name server returning CNAME pointing to ".") pointer wrapped to (void *) -1 resulting in segmentation fault on an attempt to dereference it. Reported by Lanshun Zhou.
* Version bump.Maxim Dounin2012-04-26
|
* Version bump.Maxim Dounin2012-04-23
|