nginx_tcp_proxy_module
nginx_tcp_proxy_module copied to clipboard
add the feature of tcp proxy with nginx, with health check and status monitor
addrs的定义文件在nginx/src/core/ngx_resolver.h nginx_tcp_proxy_module的头文件在ngx_tcp_upstream.h的结构体ngx_tcp_upstream_resolved_s中 这是因为在1.9版本起addrs的结构体由ngx_addr_t 改为ngx_resolver_addr_t,如果只是为了安装1.8上,只要直接将ngx_resolver_addr_t改为ngx_addr_t 即可,如果要兼容所有版本,改为下面的代码 # if (nginx_version) >= 1005008 # if (nginx_version) >= 1009001 ngx_resolver_addr_t *addrs; # else ngx_addr_t *addrs; # endif # else in_addr_t *addrs; # endif
/home/triploc/nginx_tcp_proxy_module-master/ngx_tcp_upstream.h:143: 错误:expected specifier-qualifier-list before ‘ngx_resolver_addr_t’ make[1]: **\* [objs/addon/nginx_tcp_proxy_module-master/ngx_tcp.o] 错误 1
When patch with tcp.patch on nginx 1.9.5, the patch is not working at all patching file src/core/ngx_log.c Hunk #1 FAILED at 66. 1 out of 1 hunk FAILED -- saving...
ngx_tcp_core_module.c文件ngx_tcp_core_listen函数中488行会判断listen端口号是否重复 if (port != u.port) 但是比较符右边的port是由配置端口号字符串强制转换而来,和机器字节序相同,而左边的端口号是从sockaddr_in结构体中读出,是网络字节序,对于机器字节序和网络字节序不同的服务器,会出现判断错误的情况,例如:4660和13345两个端口会被认为重复,就是因为这两个端口的字节序正好相反 看一下是不是有特殊背景还是一个bug?
背景:nginx-1.8.1+nginx_tcp_proxy_module-0.4.5(linux)代理mysql,每个请求都会创建一个连接,共两个请求 问题:偶发出现第一个请求代理正常,第二个请求超时失败,通过打开debug日志查看,正常的请求在代理到后端mysql时第一个epoll事件是写事件(即EPOLLOUT,应该就是连接建立触发的),而失败的这一次则是读写事件(EPOLLIN+EPOLLOUT)都有,而且check broken连接时能够peek到后端mysql发过来的数据,但是这个两个事件就会导致tcp proxy处理异常,从源码来看,tcp proxy认为第一个事件是连接事件,因此做初始化动作,而如果异常情况下读写事件都返回则会将EPOLLIN事件用于初始化,EPOLLOUT则导致了后续处理流程走错,变成等待客户端发送数据(其实第一个数据应该是服务端发送) 正常请求日志:2016/xx/xx 02:05:47 [debug] 17605#0: epoll: fd:53 ev:0004 d:00007FC63B17C380 异常请求日志:2016/xx/xx 02:05:50 [debug] 17605#0: epoll: fd:55 ev:0005 d:00007FC63B17C530 用nginx-1.4.7+nginx_tcp_proxy_module没有遇到这个问题,请大神看看是不是有变更或者是否有解决思路、方法?
Hi! Could you help me? I have got error message nginx: [emerg] host not found in upstream "chat1" in /etc/nginx/sites-enabled/chat.bartermill.com:23 I have put into nginx.conf at the and of file...
支持TCP延时一个值?
This PR is a hack that implements PROXY protocol (http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt) which allows upstream TCP servers to be notified the original IP and port of the client. Tested with nginx 1.7.9....
Can I add geoip country blocking in Nginx tcp block as like as http block ?. As I need to allow specific region to access the tcp connection.
hello tried to install nginx _tcp_proxy _module with nginx -1.6 but it gives error when i type ./configure it gives Configuration summary - using system PCRE library - using system...