nginx-sticky-module 安装遇到的问题

Posted on Posted in nginx

nginx-sticky-module 安装遇到的问题

/usr/local/src/nginx-sticky-module-1.1/ngx_http_sticky_module.c: In function ‘ngx_http_get_sticky_peer’:
/usr/local/src/nginx-sticky-module-1.1/ngx_http_sticky_module.c:333:21: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
   iphp->rrp.current = iphp->selected_peer;
                     ^
cc1: all warnings being treated as errors
objs/Makefile:1647: recipe for target 'objs/addon/nginx-sticky-module-1.1/ngx_http_sticky_module.o' failed
make[1]: *** [objs/addon/nginx-sticky-module-1.1/ngx_http_sticky_module.o] Error 1
make[1]: Leaving directory '/usr/local/src/nginx-1.14.1'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

解决

vim ngx_http_sticky_misc.c 

#include <nginx.h>
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <ngx_md5.h>
#include <ngx_sha1.h>
# 下面两行
#include <openssl/sha.h>
#include <openssl/md5.h>

#  第  281  行
digest->len = ngx_sock_ntop(in, sizeof(struct sockaddr_in), digest->data, len, 1);

vim ngx_http_sticky_module.c
#  第 6 行 添加
#include <nginx.h>

# 第 333 行替换

#if defined(nginx_version) && nginx_version >= 1009000
iphp->rrp.current = peer;
#else
iphp->rrp.current = iphp->selected_peer;
#endif
» 转载请注明来源:呢喃 » nginx-sticky-module 安装遇到的问题

Leave a Reply

Your email address will not be published. Required fields are marked *

5 × four =