Permalink
Browse files

changed the directive "check_status" to "tcp_check_status"

avoid the conflict with ngx_http_upstream_check_module
1 parent 2cbb026 commit 4c76e4fa886aba26000d7854adf2b96975410aa8 @yaoweibin committed Mar 5, 2013
Showing with 44 additions and 14 deletions.
  1. +3 −3 README
  2. +4 −4 doc/README.html
  3. +3 −3 doc/README.txt
  4. +4 −4 doc/README.wiki
  5. +30 −0 ngx_tcp_upstream_check.c
View
6 README
@@ -26,7 +26,7 @@ Synopsis
listen 80;
location /status {
- check_status;
+ tcp_check_status;
}
}
}
@@ -343,8 +343,8 @@ Directives
shared memory for health check may be not enough, you can enlarged it by
this directive.
- check_status
- syntax: *check_status*
+ tcp_check_status
+ syntax: *tcp_check_status*
default: *none*
View
@@ -49,7 +49,7 @@
<li><a href="#check_smtp_send">check_smtp_send</a></li>
<li><a href="#check_smtp_expect_alive">check_smtp_expect_alive</a></li>
<li><a href="#check_shm_size">check_shm_size</a></li>
- <li><a href="#check_status">check_status</a></li>
+ <li><a href="#tcp_check_status">tcp_check_status</a></li>
<li><a href="#busyness">busyness</a></li>
<li><a href="#ip_hash">ip_hash</a></li>
</ul>
@@ -143,7 +143,7 @@
listen 80;</pre>
<pre>
location /status {
- check_status;
+ tcp_check_status;
}
}
}</pre>
@@ -399,8 +399,8 @@
<p><strong>description:</strong> If you store hundreds of servers in one upstream block, the shared memory for health check may be not enough, you can enlarged it by this directive.</p>
<p>
</p>
-<h3><a name="check_status">check_status</a></h3>
-<p><strong>syntax:</strong> <em>check_status</em></p>
+<h3><a name="tcp_check_status">tcp_check_status</a></h3>
+<p><strong>syntax:</strong> <em>tcp_check_status</em></p>
<p><strong>default:</strong> <em>none</em></p>
<p><strong>context:</strong> <em>location</em></p>
<p><strong>description:</strong> Display the health checking servers' status by HTTP. This directive is set in the http block.</p>
View
@@ -26,7 +26,7 @@ Synopsis
listen 80;
location /status {
- check_status;
+ tcp_check_status;
}
}
}
@@ -343,8 +343,8 @@ Directives
shared memory for health check may be not enough, you can enlarged it by
this directive.
- check_status
- syntax: *check_status*
+ tcp_check_status
+ syntax: *tcp_check_status*
default: *none*
View
@@ -1,4 +1,4 @@
-= Name =
+= Name =
'''nginx_tcp_proxy_module''' - support TCP proxy with Nginx
@@ -30,7 +30,7 @@ http {
listen 80;
location /status {
- check_status;
+ tcp_check_status;
}
}
}
@@ -316,9 +316,9 @@ The parameters' meanings are:
'''description:''' If you store hundreds of servers in one upstream block, the shared memory for health check may be not enough, you can enlarged it by this directive.
-=== check_status ===
+=== tcp_check_status ===
-'''syntax:''' ''check_status''
+'''syntax:''' ''tcp_check_status''
'''default:''' ''none''
View
@@ -46,6 +46,8 @@ static void ngx_tcp_check_imap_reinit(ngx_tcp_check_peer_conf_t *peer_conf);
static char * ngx_tcp_upstream_check_status_set_status(ngx_conf_t *cf,
ngx_command_t *cmd, void *conf);
+static char * ngx_tcp_upstream_check_status(ngx_conf_t *cf,
+ ngx_command_t *cmd, void *conf);
#define RANDOM "NGX_TCP_CHECK_SSL_HELLO\n\n\n\n\n"
@@ -168,6 +170,11 @@ static check_conf_t ngx_check_types[] = {
{0, "", ngx_null_string, 0, NULL, NULL, NULL, NULL, NULL, 0}
};
+
+static ngx_conf_deprecated_t ngx_conf_deprecated_check_status = {
+ ngx_conf_deprecated, "check_status", "tcp_check_status"
+};
+
static ngx_command_t ngx_tcp_upstream_check_status_commands[] = {
{ ngx_string("check_status"),
@@ -177,6 +184,13 @@ static ngx_command_t ngx_tcp_upstream_check_status_commands[] = {
0,
NULL },
+ { ngx_string("tcp_check_status"),
+ NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS,
+ ngx_tcp_upstream_check_status,
+ 0,
+ 0,
+ NULL },
+
ngx_null_command
};
@@ -1918,6 +1932,22 @@ ngx_tcp_upstream_check_status_set_status(ngx_conf_t *cf,
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
+ ngx_conf_deprecated(cf, &ngx_conf_deprecated_check_status, NULL);
+
+ clcf->handler = ngx_tcp_upstream_check_status_handler;
+
+ return NGX_CONF_OK;
+}
+
+
+static char *
+ngx_tcp_upstream_check_status(ngx_conf_t *cf,
+ ngx_command_t *cmd, void *conf)
+{
+ ngx_http_core_loc_conf_t *clcf;
+
+ clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
+
clcf->handler = ngx_tcp_upstream_check_status_handler;
return NGX_CONF_OK;

0 comments on commit 4c76e4f

Please sign in to comment.