comparison src/http/modules/ngx_http_fastcgi_module.c @ 78:9db7e0b5b27f NGINX_0_1_39

nginx 0.1.39 *) The changes in the ngx_http_charset_module: the "default_charset" directive was canceled; the "charset" directive sets the response charset; the "source_charset" directive sets the source charset only. *) Bugfix: the backend "WWW-Authenticate" header line did not transferred while the 401 response code redirecting. *) Bugfix: the ngx_http_proxy_module and ngx_http_fastcgi_module may close a connection before anything was transferred to a client; bug appeared in 0.1.38. *) Workaround: the Linux glibc crypt_r() initialization bug. *) Bugfix: the ngx_http_ssi_module did not support the relative URI in the "include virtual" command. *) Bugfix: if the backend response had the "Location" header line and nginx should not rewrite this line, then the 500 code response body was transferred; bug appeared in 0.1.29. *) Bugfix: some directives of the ngx_http_proxy_module and ngx_http_fastcgi_module were not inherited from the server to the location level; bug appeared in 0.1.29. *) Bugfix: the ngx_http_ssl_module did not support the certificate chain. *) Bugfix: the ngx_http_autoindex_module did not show correctly the long file names; bug appeared in 0.1.38. *) Bugfixes in IMAP/POP3 proxy in interaction with a backend at the login state.
author Igor Sysoev <http://sysoev.ru>
date Thu, 14 Jul 2005 00:00:00 +0400
parents 5db440287648
children 962c43960644
comparison
equal deleted inserted replaced
77:e6b3de2dc637 78:9db7e0b5b27f
275 275
276 { ngx_string("fastcgi_busy_buffers_size"), 276 { ngx_string("fastcgi_busy_buffers_size"),
277 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 277 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
278 ngx_conf_set_size_slot, 278 ngx_conf_set_size_slot,
279 NGX_HTTP_LOC_CONF_OFFSET, 279 NGX_HTTP_LOC_CONF_OFFSET,
280 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.busy_buffers_size), 280 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.busy_buffers_size_conf),
281 NULL }, 281 NULL },
282 282
283 { ngx_string("fastcgi_temp_path"), 283 { ngx_string("fastcgi_temp_path"),
284 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234, 284 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
285 ngx_conf_set_path_slot, 285 ngx_conf_set_path_slot,
289 289
290 { ngx_string("fastcgi_max_temp_file_size"), 290 { ngx_string("fastcgi_max_temp_file_size"),
291 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 291 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
292 ngx_conf_set_size_slot, 292 ngx_conf_set_size_slot,
293 NGX_HTTP_LOC_CONF_OFFSET, 293 NGX_HTTP_LOC_CONF_OFFSET,
294 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.max_temp_file_size), 294 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.max_temp_file_size_conf),
295 NULL }, 295 NULL },
296 296
297 { ngx_string("fastcgi_temp_file_write_size"), 297 { ngx_string("fastcgi_temp_file_write_size"),
298 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 298 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
299 ngx_conf_set_size_slot, 299 ngx_conf_set_size_slot,
300 NGX_HTTP_LOC_CONF_OFFSET, 300 NGX_HTTP_LOC_CONF_OFFSET,
301 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.temp_file_write_size), 301 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.temp_file_write_size_conf),
302 NULL }, 302 NULL },
303 303
304 { ngx_string("fastcgi_next_upstream"), 304 { ngx_string("fastcgi_next_upstream"),
305 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_ANY, 305 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_ANY,
306 ngx_conf_set_bitmask_slot, 306 ngx_conf_set_bitmask_slot,
999 999
1000 if (status == NGX_ERROR) { 1000 if (status == NGX_ERROR) {
1001 return NGX_HTTP_INTERNAL_SERVER_ERROR; 1001 return NGX_HTTP_INTERNAL_SERVER_ERROR;
1002 } 1002 }
1003 1003
1004 r->headers_out.status = status; 1004 u->headers_in.status_n = status;
1005 r->headers_out.status_line = *status_line; 1005 u->headers_in.status_line = *status_line;
1006 1006
1007 } else { 1007 } else {
1008 r->headers_out.status = 200; 1008 u->headers_in.status_n = 200;
1009 r->headers_out.status_line.len = sizeof("200 OK") - 1; 1009 u->headers_in.status_line.len = sizeof("200 OK") - 1;
1010 r->headers_out.status_line.data = (u_char *) "200 OK"; 1010 u->headers_in.status_line.data = (u_char *) "200 OK";
1011 } 1011 }
1012 1012
1013 u->state->status = r->headers_out.status; 1013 u->state->status = u->headers_in.status_n;
1014 #if 0 1014 #if 0
1015 if (u->cachable) { 1015 if (u->cachable) {
1016 u->cachable = ngx_http_upstream_is_cachable(r); 1016 u->cachable = ngx_http_upstream_is_cachable(r);
1017 } 1017 }
1018 #endif 1018 #endif
1450 conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC; 1450 conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
1451 conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC; 1451 conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
1452 1452
1453 conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE; 1453 conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
1454 conf->upstream.header_buffer_size = NGX_CONF_UNSET_SIZE; 1454 conf->upstream.header_buffer_size = NGX_CONF_UNSET_SIZE;
1455 conf->upstream.busy_buffers_size = NGX_CONF_UNSET_SIZE; 1455
1456 conf->upstream.max_temp_file_size = NGX_CONF_UNSET_SIZE; 1456 conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
1457 conf->upstream.temp_file_write_size = NGX_CONF_UNSET_SIZE; 1457 conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
1458 conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
1458 1459
1459 conf->upstream.pass_unparsed_uri = NGX_CONF_UNSET; 1460 conf->upstream.pass_unparsed_uri = NGX_CONF_UNSET;
1460 conf->upstream.method = NGX_CONF_UNSET_UINT; 1461 conf->upstream.method = NGX_CONF_UNSET_UINT;
1461 conf->upstream.pass_request_headers = NGX_CONF_UNSET; 1462 conf->upstream.pass_request_headers = NGX_CONF_UNSET;
1462 conf->upstream.pass_request_body = NGX_CONF_UNSET; 1463 conf->upstream.pass_request_body = NGX_CONF_UNSET;
1521 if (size < conf->upstream.bufs.size) { 1522 if (size < conf->upstream.bufs.size) {
1522 size = conf->upstream.bufs.size; 1523 size = conf->upstream.bufs.size;
1523 } 1524 }
1524 1525
1525 1526
1526 ngx_conf_merge_size_value(conf->upstream.busy_buffers_size, 1527 ngx_conf_merge_size_value(conf->upstream.busy_buffers_size_conf,
1527 prev->upstream.busy_buffers_size, 1528 prev->upstream.busy_buffers_size_conf,
1528 NGX_CONF_UNSET_SIZE); 1529 NGX_CONF_UNSET_SIZE);
1529 1530
1530 if (conf->upstream.busy_buffers_size == NGX_CONF_UNSET_SIZE) { 1531 if (conf->upstream.busy_buffers_size_conf == NGX_CONF_UNSET_SIZE) {
1531 conf->upstream.busy_buffers_size = 2 * size; 1532 conf->upstream.busy_buffers_size = 2 * size;
1532 1533 } else {
1533 } else if (conf->upstream.busy_buffers_size < size) { 1534 conf->upstream.busy_buffers_size =
1535 conf->upstream.busy_buffers_size_conf;
1536 }
1537
1538 if (conf->upstream.busy_buffers_size < size) {
1534 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1539 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1535 "\"fastcgi_busy_buffers_size\" must be equal or bigger than " 1540 "\"fastcgi_busy_buffers_size\" must be equal or bigger than "
1536 "maximum of the value of \"fastcgi_header_buffer_size\" and " 1541 "maximum of the value of \"fastcgi_header_buffer_size\" and "
1537 "one of the \"fastcgi_buffers\""); 1542 "one of the \"fastcgi_buffers\"");
1538 1543
1539 return NGX_CONF_ERROR; 1544 return NGX_CONF_ERROR;
1540 1545 }
1541 } else if (conf->upstream.busy_buffers_size 1546
1542 > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size) 1547 if (conf->upstream.busy_buffers_size
1548 > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size)
1543 { 1549 {
1544 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1550 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1545 "\"fastcgi_busy_buffers_size\" must be less than " 1551 "\"fastcgi_busy_buffers_size\" must be less than "
1546 "the size of all \"fastcgi_buffers\" minus one buffer"); 1552 "the size of all \"fastcgi_buffers\" minus one buffer");
1547 1553
1548 return NGX_CONF_ERROR; 1554 return NGX_CONF_ERROR;
1549 } 1555 }
1550 1556
1551 1557
1552 ngx_conf_merge_size_value(conf->upstream.temp_file_write_size, 1558 ngx_conf_merge_size_value(conf->upstream.temp_file_write_size_conf,
1553 prev->upstream.temp_file_write_size, 1559 prev->upstream.temp_file_write_size_conf,
1554 NGX_CONF_UNSET_SIZE); 1560 NGX_CONF_UNSET_SIZE);
1555 1561
1556 if (conf->upstream.temp_file_write_size == NGX_CONF_UNSET_SIZE) { 1562 if (conf->upstream.temp_file_write_size_conf == NGX_CONF_UNSET_SIZE) {
1557 conf->upstream.temp_file_write_size = 2 * size; 1563 conf->upstream.temp_file_write_size = 2 * size;
1558 1564 } else {
1559 } else if (conf->upstream.temp_file_write_size < size) { 1565 conf->upstream.temp_file_write_size =
1566 conf->upstream.temp_file_write_size_conf;
1567 }
1568
1569 if (conf->upstream.temp_file_write_size < size) {
1560 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1570 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1561 "\"fastcgi_temp_file_write_size\" must be equal or bigger than " 1571 "\"fastcgi_temp_file_write_size\" must be equal or bigger than "
1562 "maximum of the value of \"fastcgi_header_buffer_size\" and " 1572 "maximum of the value of \"fastcgi_header_buffer_size\" and "
1563 "one of the \"fastcgi_buffers\""); 1573 "one of the \"fastcgi_buffers\"");
1564 1574
1565 return NGX_CONF_ERROR; 1575 return NGX_CONF_ERROR;
1566 } 1576 }
1567 1577
1568 1578
1569 ngx_conf_merge_size_value(conf->upstream.max_temp_file_size, 1579 ngx_conf_merge_size_value(conf->upstream.max_temp_file_size_conf,
1570 prev->upstream.max_temp_file_size, 1580 prev->upstream.max_temp_file_size_conf,
1571 NGX_CONF_UNSET_SIZE); 1581 NGX_CONF_UNSET_SIZE);
1572 1582
1573 if (conf->upstream.max_temp_file_size == NGX_CONF_UNSET_SIZE) { 1583 if (conf->upstream.max_temp_file_size_conf == NGX_CONF_UNSET_SIZE) {
1574
1575 conf->upstream.max_temp_file_size = 1024 * 1024 * 1024; 1584 conf->upstream.max_temp_file_size = 1024 * 1024 * 1024;
1576 1585 } else {
1577 } else if (conf->upstream.max_temp_file_size != 0 1586 conf->upstream.max_temp_file_size =
1578 && conf->upstream.max_temp_file_size < size) 1587 conf->upstream.max_temp_file_size_conf;
1588 }
1589
1590 if (conf->upstream.max_temp_file_size != 0
1591 && conf->upstream.max_temp_file_size < size)
1579 { 1592 {
1580 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1593 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1581 "\"fastcgi_max_temp_file_size\" must be equal to zero to disable " 1594 "\"fastcgi_max_temp_file_size\" must be equal to zero to disable "
1582 "the temporary files usage or must be equal or bigger than " 1595 "the temporary files usage or must be equal or bigger than "
1583 "maximum of the value of \"fastcgi_header_buffer_size\" and " 1596 "maximum of the value of \"fastcgi_header_buffer_size\" and "
1596 ngx_conf_merge_path_value(conf->upstream.temp_path, 1609 ngx_conf_merge_path_value(conf->upstream.temp_path,
1597 prev->upstream.temp_path, 1610 prev->upstream.temp_path,
1598 NGX_HTTP_FASTCGI_TEMP_PATH, 1, 2, 0, 1611 NGX_HTTP_FASTCGI_TEMP_PATH, 1, 2, 0,
1599 ngx_garbage_collector_temp_handler, cf); 1612 ngx_garbage_collector_temp_handler, cf);
1600 1613
1601 ngx_conf_merge_msec_value(conf->upstream.pass_unparsed_uri, 1614 ngx_conf_merge_value(conf->upstream.pass_unparsed_uri,
1602 prev->upstream.pass_unparsed_uri, 0); 1615 prev->upstream.pass_unparsed_uri, 0);
1603 1616
1604 if (conf->upstream.pass_unparsed_uri && conf->upstream.location->len > 1) { 1617 if (conf->upstream.pass_unparsed_uri && conf->upstream.location->len > 1) {
1605 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, 1618 ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
1606 "\"fastcgi_pass_unparsed_uri\" can be set for " 1619 "\"fastcgi_pass_unparsed_uri\" can be set for "
1615 ngx_conf_merge_value(conf->upstream.pass_request_headers, 1628 ngx_conf_merge_value(conf->upstream.pass_request_headers,
1616 prev->upstream.pass_request_headers, 1); 1629 prev->upstream.pass_request_headers, 1);
1617 ngx_conf_merge_value(conf->upstream.pass_request_body, 1630 ngx_conf_merge_value(conf->upstream.pass_request_body,
1618 prev->upstream.pass_request_body, 1); 1631 prev->upstream.pass_request_body, 1);
1619 1632
1620 ngx_conf_merge_msec_value(conf->upstream.redirect_errors, 1633 ngx_conf_merge_value(conf->upstream.redirect_errors,
1621 prev->upstream.redirect_errors, 0); 1634 prev->upstream.redirect_errors, 0);
1622 1635
1623 ngx_conf_merge_msec_value(conf->upstream.pass_x_powered_by, 1636 ngx_conf_merge_value(conf->upstream.pass_x_powered_by,
1624 prev->upstream.pass_x_powered_by, 1); 1637 prev->upstream.pass_x_powered_by, 1);
1625 1638
1626 1639
1627 ngx_conf_merge_str_value(conf->index, prev->index, ""); 1640 ngx_conf_merge_str_value(conf->index, prev->index, "");
1628 1641
1629 if (conf->peers == NULL) { 1642 if (conf->peers == NULL) {
1630 conf->peers = prev->peers; 1643 conf->peers = prev->peers;
1631 conf->upstream = prev->upstream;
1632 } 1644 }
1633 1645
1634 if (conf->params_source == NULL) { 1646 if (conf->params_source == NULL) {
1635 conf->params_source = prev->params_source; 1647 conf->params_source = prev->params_source;
1636 conf->params_len = prev->params_len; 1648 conf->params_len = prev->params_len;