comparison src/http/modules/ngx_http_proxy_module.c @ 506:b9fdcaf2062b NGINX_0_7_65

nginx 0.7.65 *) Security: now nginx/Windows ignores trailing spaces in URI. Thanks to Dan Crowley, Core Security Technologies. *) Security: now nginx/Windows ignores short files names. Thanks to Dan Crowley, Core Security Technologies. *) Change: now the "009" status code is written to an access log for proxied HTTP/0.9 responses. *) Change: now the default buffer size of the "large_client_header_buffers" directive is 8K. Thanks to Andrew Cholakian. *) Change: now default SSL ciphers are "HIGH:!ADH:!MD5". *) Change: now SSLv2 protocol is disabled by default. *) Change: now $host variable value is always low case. *) Feature: the conf/fastcgi.conf for simple FastCGI configurations. *) Feature: now URI part is not required a "proxy_pass" directive if variables are used. *) Feature: the $ssl_session_id variable. *) Bugfix: if a proxied or FastCGI request was internally redirected to another proxied or FastCGI location, then $upstream_response_time variable may have abnormally large value; the bug had appeared in 0.7.63. *) Bugfix: if the "expires modified" set date in the past, then a negative number was set in the "Cache-Control" response header line. Thanks to Alex Kapranoff. *) Bugfix: nginx closed a connection if a cached response had an empty body. Thanks to Piotr Sikora. *) Bugfix: nginx cached a 304 response if there was the "If-None-Match" header line in a proxied request. Thanks to Tim Dettrick and David Kostal. *) Bugfix: nginx did not treat a comma as separator in the "Cache-Control" backend response header line. *) Bugfix: cached HTTP/0.9 responses were handled incorrectly. *) Bugfix: nginx sent gzipped responses to clients those do not support gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared in 0.8.16. *) Bugfix: nginx always added "Content-Encoding: gzip" response header line in 304 responses sent by ngx_http_gzip_static_module. *) Bugfix: the "!-x" operator did not work. Thanks to Maxim Dounin. *) Bugfix: a segmentation fault might occur in a worker process, if limit_rate was used in HTTPS server. Thanks to Maxim Dounin. *) Bugfix: a segmentation fault might occur in a worker process while $limit_rate logging. Thanks to Maxim Dounin. *) Bugfix: nginx did not support dates in 2038 year on 32-bit platforms; *) Bugfix: nginx/Windows tried to delete a temporary file twice if the file should replace an already existent file. *) Bugfix: nginx/Windows tried to rename a temporary file twice if the file should replace an already existent file. *) Bugfix: nginx/Windows might not create temporary file, a cache file, or "proxy/fastcgi_store"d file if a worker had no enough access rights for top level directories. *) Bugfix: in UTF-8 encoding support by "try_files" directive in nginx/Windows. *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module. Thanks to Maxim Dounin. *) Bugfix: the ngx_http_autoindex_module did not show the trailing slash in links to a directory; the bug had appeared in 0.7.15. *) Bugfix: nginx did not close a log file set by the --error-log-path configuration option; the bug had appeared in 0.7.53. *) Bugfix: "addition_types" directive was incorrectly named "addtion_types". *) Bugfix: invalid request line in $request variable was written in access_log only if error_log was set to "info" or "debug" level.
author Igor Sysoev <http://sysoev.ru>
date Mon, 01 Feb 2010 00:00:00 +0000
parents 89dc5654117c
children 68c0ae0a4959
comparison
equal deleted inserted replaced
505:c62da3dcc544 506:b9fdcaf2062b
528 { ngx_string("Connection"), ngx_string("close") }, 528 { ngx_string("Connection"), ngx_string("close") },
529 { ngx_string("Keep-Alive"), ngx_string("") }, 529 { ngx_string("Keep-Alive"), ngx_string("") },
530 { ngx_string("Expect"), ngx_string("") }, 530 { ngx_string("Expect"), ngx_string("") },
531 { ngx_string("If-Modified-Since"), ngx_string("") }, 531 { ngx_string("If-Modified-Since"), ngx_string("") },
532 { ngx_string("If-Unmodified-Since"), ngx_string("") }, 532 { ngx_string("If-Unmodified-Since"), ngx_string("") },
533 { ngx_string("If-Match-None"), ngx_string("") }, 533 { ngx_string("If-None-Match"), ngx_string("") },
534 { ngx_string("If-Match"), ngx_string("") }, 534 { ngx_string("If-Match"), ngx_string("") },
535 { ngx_string("Range"), ngx_string("") }, 535 { ngx_string("Range"), ngx_string("") },
536 { ngx_string("If-Range"), ngx_string("") }, 536 { ngx_string("If-Range"), ngx_string("") },
537 { ngx_null_string, ngx_null_string } 537 { ngx_null_string, ngx_null_string }
538 }; 538 };
715 } 715 }
716 716
717 return NGX_ERROR; 717 return NGX_ERROR;
718 } 718 }
719 719
720 if (url.uri.len && url.uri.data[0] == '?') { 720 if (url.uri.len) {
721 p = ngx_pnalloc(r->pool, url.uri.len + 1); 721 if (url.uri.data[0] == '?') {
722 if (p == NULL) { 722 p = ngx_pnalloc(r->pool, url.uri.len + 1);
723 return NGX_ERROR; 723 if (p == NULL) {
724 } 724 return NGX_ERROR;
725 725 }
726 *p++ = '/'; 726
727 ngx_memcpy(p, url.uri.data, url.uri.len); 727 *p++ = '/';
728 728 ngx_memcpy(p, url.uri.data, url.uri.len);
729 url.uri.len++; 729
730 url.uri.data = p - 1; 730 url.uri.len++;
731 url.uri.data = p - 1;
732 }
733
734 } else {
735 url.uri = r->unparsed_uri;
731 } 736 }
732 737
733 ctx->vars.key_start = u->schema; 738 ctx->vars.key_start = u->schema;
734 739
735 ngx_http_proxy_set_vars(&url, &ctx->vars); 740 ngx_http_proxy_set_vars(&url, &ctx->vars);
1216 1221
1217 #if (NGX_HTTP_CACHE) 1222 #if (NGX_HTTP_CACHE)
1218 1223
1219 if (r->cache) { 1224 if (r->cache) {
1220 r->http_version = NGX_HTTP_VERSION_9; 1225 r->http_version = NGX_HTTP_VERSION_9;
1221 u->headers_in.status_n = NGX_HTTP_OK;
1222 return NGX_OK; 1226 return NGX_OK;
1223 } 1227 }
1224 1228
1225 #endif 1229 #endif
1226 1230
1232 return NGX_HTTP_UPSTREAM_INVALID_HEADER; 1236 return NGX_HTTP_UPSTREAM_INVALID_HEADER;
1233 } 1237 }
1234 #endif 1238 #endif
1235 1239
1236 r->http_version = NGX_HTTP_VERSION_9; 1240 r->http_version = NGX_HTTP_VERSION_9;
1237 u->headers_in.status_n = NGX_HTTP_OK;
1238 u->state->status = NGX_HTTP_OK; 1241 u->state->status = NGX_HTTP_OK;
1239 1242
1240 return NGX_OK; 1243 return NGX_OK;
1241 } 1244 }
1242 1245
2583 return "is duplicate"; 2586 return "is duplicate";
2584 } 2587 }
2585 2588
2586 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); 2589 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
2587 2590
2591 clcf->handler = ngx_http_proxy_handler;
2592
2593 if (clcf->name.data[clcf->name.len - 1] == '/') {
2594 clcf->auto_redirect = 1;
2595 }
2596
2588 value = cf->args->elts; 2597 value = cf->args->elts;
2589 2598
2590 url = &value[1]; 2599 url = &value[1];
2591 2600
2592 n = ngx_http_script_variables_count(url); 2601 n = ngx_http_script_variables_count(url);
2611 if (ngx_http_proxy_set_ssl(cf, plcf) != NGX_OK) { 2620 if (ngx_http_proxy_set_ssl(cf, plcf) != NGX_OK) {
2612 return NGX_CONF_ERROR; 2621 return NGX_CONF_ERROR;
2613 } 2622 }
2614 #endif 2623 #endif
2615 2624
2616 clcf->handler = ngx_http_proxy_handler;
2617
2618 return NGX_CONF_OK; 2625 return NGX_CONF_OK;
2619 } 2626 }
2620 2627
2621 if (ngx_strncasecmp(url->data, (u_char *) "http://", 7) == 0) { 2628 if (ngx_strncasecmp(url->data, (u_char *) "http://", 7) == 0) {
2622 add = 7; 2629 add = 7;
2658 plcf->vars.schema.len = add; 2665 plcf->vars.schema.len = add;
2659 plcf->vars.schema.data = url->data; 2666 plcf->vars.schema.data = url->data;
2660 plcf->vars.key_start = plcf->vars.schema; 2667 plcf->vars.key_start = plcf->vars.schema;
2661 2668
2662 ngx_http_proxy_set_vars(&u, &plcf->vars); 2669 ngx_http_proxy_set_vars(&u, &plcf->vars);
2663
2664 clcf->handler = ngx_http_proxy_handler;
2665 2670
2666 plcf->location = clcf->name; 2671 plcf->location = clcf->name;
2667 2672
2668 if (clcf->named 2673 if (clcf->named
2669 #if (NGX_PCRE) 2674 #if (NGX_PCRE)
2684 plcf->location.len = 0; 2689 plcf->location.len = 0;
2685 } 2690 }
2686 2691
2687 plcf->url = *url; 2692 plcf->url = *url;
2688 2693
2689 if (clcf->name.data[clcf->name.len - 1] == '/') {
2690 clcf->auto_redirect = 1;
2691 }
2692
2693 return NGX_CONF_OK; 2694 return NGX_CONF_OK;
2694 } 2695 }
2695 2696
2696 2697
2697 static char * 2698 static char *