Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update Nginx module to latest Nginx API.

  • Loading branch information...
commit 7b92b36166be8151de80c1320425eaf9bdc3a1db 1 parent c923e2d
@FooBarWidget FooBarWidget authored
View
1  .gitignore
@@ -36,6 +36,7 @@ doc/*.html
test/test.log
test/apache2.log
test/config.yml
+test/config.json
test/coverage
test/cxx/CxxTestMain
test/oxt/oxt_test_main
View
32 ext/nginx/Configuration.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) 2007 Manlio Perillo (manlio.perillo@gmail.com)
- * Copyright (C) 2010 Phusion
+ * Copyright (C) 2010, 2011, 2012 Phusion
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -335,6 +335,14 @@ passenger_create_loc_conf(ngx_conf_t *cf)
conf->upstream_config.pass_request_headers = NGX_CONF_UNSET;
conf->upstream_config.pass_request_body = NGX_CONF_UNSET;
+#if (NGX_HTTP_CACHE)
+ conf->upstream_config.cache = NGX_CONF_UNSET_PTR;
+ conf->upstream_config.cache_min_uses = NGX_CONF_UNSET_UINT;
+ conf->upstream_config.cache_bypass = NGX_CONF_UNSET_PTR;
+ conf->upstream_config.no_cache = NGX_CONF_UNSET_PTR;
+ conf->upstream_config.cache_valid = NGX_CONF_UNSET_PTR;
+#endif
+
conf->upstream_config.intercept_errors = NGX_CONF_UNSET;
conf->upstream_config.cyclic_temp_file = 0;
@@ -511,8 +519,8 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream_config.busy_buffers_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"passenger_busy_buffers_size\" must be equal or bigger than "
- "maximum of the value of \"passenger_buffer_size\" and "
+ "\"passenger_busy_buffers_size\" must be equal to or greater "
+ "than the maximum of the value of \"passenger_buffer_size\" and "
"one of the \"passenger_buffers\"");
return NGX_CONF_ERROR;
@@ -542,8 +550,8 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream_config.temp_file_write_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"passenger_temp_file_write_size\" must be equal or bigger than "
- "maximum of the value of \"passenger_buffer_size\" and "
+ "\"passenger_temp_file_write_size\" must be equal to or greater than "
+ "the maximum of the value of \"passenger_buffer_size\" and "
"one of the \"passenger_buffers\"");
return NGX_CONF_ERROR;
@@ -566,8 +574,8 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"passenger_max_temp_file_size\" must be equal to zero to disable "
- "the temporary files usage or must be equal or bigger than "
- "maximum of the value of \"passenger_buffer_size\" and "
+ "temporary files usage or must be equal to or greater than "
+ "the maximum of the value of \"passenger_buffer_size\" and "
"one of the \"passenger_buffers\"");
return NGX_CONF_ERROR;
@@ -639,6 +647,14 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
conf->cache_key = prev->cache_key;
}
+ #if NGINX_VERSION_NUM >= 1002000
+ ngx_conf_merge_value(conf->upstream_config.cache_lock,
+ prev->upstream_config.cache_lock, 0);
+
+ ngx_conf_merge_msec_value(conf->upstream_config.cache_lock_timeout,
+ prev->upstream_config.cache_lock_timeout, 5000);
+ #endif
+
#endif
ngx_conf_merge_value(conf->upstream_config.pass_request_headers,
@@ -1273,7 +1289,7 @@ const ngx_command_t passenger_commands[] = {
NULL },
{ ngx_string("passenger_pass_header"),
- NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
+ NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
ngx_conf_set_str_array_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(passenger_loc_conf_t, upstream_config.pass_headers),
View
11 ext/nginx/ContentHandler.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) 2007 Manlio Perillo (manlio.perillo@gmail.com)
- * Copyright (C) 2010 Phusion
+ * Copyright (C) 2010, 2011, 2012 Phusion
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -387,8 +387,8 @@ create_request(ngx_http_request_t *r)
app_type_string_len = sizeof("wsgi");
break;
default:
- app_type_string = (const u_char *) "rails";
- app_type_string_len = sizeof("rails");
+ app_type_string = (const u_char *) "rack";
+ app_type_string_len = sizeof("rack");
break;
}
@@ -931,7 +931,7 @@ process_status_line(ngx_http_request_t *r)
context = ngx_http_get_module_ctx(r, ngx_http_passenger_module);
if (context == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return NGX_ERROR;
}
rc = parse_status_line(r, context);
@@ -952,7 +952,6 @@ process_status_line(ngx_http_request_t *r)
}
#endif
- r->http_version = NGX_HTTP_VERSION_9;
u->headers_in.status_n = NGX_HTTP_OK;
u->state->status = NGX_HTTP_OK;
@@ -966,7 +965,7 @@ process_status_line(ngx_http_request_t *r)
u->headers_in.status_line.data = ngx_palloc(r->pool,
u->headers_in.status_line.len);
if (u->headers_in.status_line.data == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return NGX_ERROR;
}
ngx_memcpy(u->headers_in.status_line.data, context->status_start,
Please sign in to comment.
Something went wrong with that request. Please try again.