Opened 13 years ago
Closed 13 years ago
#26 closed enhancement (wontfix)
feature request about upstream module
Reported by: | lanshun zhou | Owned by: | somebody |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-module | Version: | 1.1.x |
Keywords: | upstream module | Cc: | zls.sogou@… |
uname -a: | |||
nginx -V: |
Description
Just wonder if it's possible to change the http upstream module to a non-http module, so it will be easily used to implement load balancers for other protocols like dns_proxy/mysql_proxy that has nothing to do with http protocol.
This module is used to choose a server from many, load balancing, fault tolerance and connection caching. All these features can be commonly used for all protocols. and the round robin, hash and keepalive upstream modules are useful and can be easily reused.
or just simply change prototype of ngx_http_upstream_init_peer_pt (actually it's almost done after this)
from
typedef ngx_int_t (*ngx_http_upstream_init_peer_pt)(ngx_http_request_t *r, ngx_http_upstream_srv_conf_t *us);
to
typedef ngx_int_t (*ngx_http_upstream_init_peer_pt)(ngx_http_upstream_t *upstream, ngx_http_upstream_srv_conf_t *us);
and add these fields to ngx_http_upstream_t
ngx_log_t *log; ngx_pool_t *pool;
thanks~