nginx_tcp_proxy_module
nginx_tcp_proxy_module copied to clipboard
Make issu
Hi,
thanks in advance for reading this shit.
application: nginx-1.10.1.tar.gz( download from http://nginx.org/download/nginx-1.10.1.tar.gz) nginx_tcp_proxy_module-master( downloaded from https://codeload.github.com/yaoweibin/nginx_tcp_proxy_module/zip/master) os: Ubuntu
issue 1: patch failed
Hunk #1 FAILED at 66.
1 out of 1 hunk FAILED -- saving rejects to file src/core/ngx_log.c.rej
patching file src/core/ngx_log.h
Hunk #1 FAILED at 29.
Hunk #2 FAILED at 36.
2 out of 2 hunks FAILED -- saving rejects to file src/core/ngx_log.h.rej
patching file src/event/ngx_event_connect.h
Hunk #1 succeeded at 33 (offset 1 line).
Hunk #2 succeeded at 45 with fuzz 2 (offset 2 lines).
then I manually changed the nginx according to the tcp.patch
in src/core/nginx_log.c
- "debug_http", "debug_mail", "debug_stream"
+ "debug_http", "debug_mail", "debug_stream", "debug_tcp"
in src/core/nginx_log.h
22 +#define NGX_LOG_DEBUG_TCP 0x80030 -#define NGX_LOG_DEBUG_LAST NGX_LOG_DEBUG_STREAM 31 +#define NGX_LOG_DEBUG_LAST NGX_LOG_DEBUG_TCPcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I ../nginx_tcp_proxy_module-master/modules -I ../nginx_tcp_proxy_module-master/parsers -I ../nginx_tcp_proxy_module-master -I objs -I src/http -I src/http/modules \
-o objs/addon/nginx_tcp_proxy_module-master/ngx_tcp_upstream.o \
../nginx_tcp_proxy_module-master/ngx_tcp_upstream.c../nginx_tcp_proxy_module-master/ngx_tcp_upstream.c: In function ‘ngx_tcp_upstream_resolve_handler’:../nginx_tcp_proxy_module-master/ngx_tcp_upstream.c:297:15: error: assignment from incompatible pointer type [-Werror]cc1: all warnings being treated as errorsmake[1]: **\* [objs/addon/nginx_tcp_proxy_module-master/ngx_tcp_upstream.o] Error 1make[1]: Leaving directory `/home/zhangjh/nginx-bak'make: **\* [build] Error 2I believe the problems were due to the patching not finished, kindly help on that.
嗯 我也看到了 改了这个出现 ngx_tcp_ssl_module.c ./nginx_tcp_proxy_module-0.4.5//modules/ngx_tcp_ssl_module.c: In function ‘ngx_tcp_ssl_merge_srv_conf’: ./nginx_tcp_proxy_module-0.4.5//modules/ngx_tcp_ssl_module.c:328: error: too few arguments to function ‘ngx_ssl_certificate’
看来 不兼容的问题 比较多, 改一个两个不是办法。
试了一下,兼容最新的版本是 1.6.3。
看了一下修改 if (ngx_ssl_certificate(cf, &conf->ssl, &conf->certificate, &conf->certificate_key)
为 if (ngx_ssl_certificate(cf, &conf->ssl, &conf->certificate, &conf->certificate_key, NULL) 可以编译通过,如果没使用SSL的话 不会出错。 ngx_ssl_certificate 函数多了一个conf->password对象, 而conf tcp的实现没有对应的password字段。
https://raw.githubusercontent.com/medzeus2/nginx_tcp_proxy_module/master/tcp_1_8.patch
1.8-1.10.1 的patch, 此外最新的代码已经能够支持编译了。
Thank you !!!! nginx_tcp_proxy_module still working with http://nginx.org/download/nginx-1.8.1.tar.gz but not with latest https://salsa.debian.org/nginx-team/nginx