运维小知识之nginx---..nginx-sticky-module-1.1ngx_http_sticky_misc.cIn function ‘ngx_http_sticky_misc_text_

简介:


运维小知识之nginx---..nginx-sticky-module-1.1ngx_http_sticky_misc.cIn function ‘ngx_http_sticky_misc_text_raw



 

         背景

         今天笔者在使用nginx做负载均衡的过程中遇到了一个问题,如何解决session共享的问题,稍一查找发现解决办法不少,笔者使用的是nginx的一直扩展模块(安装和配置已经在前两篇博客有简单的介绍)在安装的过程中居然出现了问题,咱也不是逃避的人,解决吧,见下文。

        

         问题描述

make[1]: Entering directory`/usr/local/nginx-1.7.4'
cc -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 objs -I src/http -Isrc/http/modules -I src/mail \
                -oobjs/addon/nginx-sticky-module-1.1/ngx_http_sticky_misc.o \
               ../nginx-sticky-module-1.1/ngx_http_sticky_misc.c
cc1: warnings being treated as errors
../nginx-sticky-module-1.1/ngx_http_sticky_misc.c:In function ‘ngx_http_sticky_misc_text_raw’:
../nginx-sticky-module-1.1/ngx_http_sticky_misc.c:281:error: passing argument 2 of ‘ngx_sock_ntop’makes integer from pointer without a cast
src/core/ngx_inet.h:110: note: expected ‘socklen_t’ but argument is of type ‘u_char *’
../nginx-sticky-module-1.1/ngx_http_sticky_misc.c:281:error: passing argument 3 of ‘ngx_sock_ntop’makes pointer from integer without a cast
src/core/ngx_inet.h:110: note: expected ‘u_char*’ but argument is of type ‘size_t’
../nginx-sticky-module-1.1/ngx_http_sticky_misc.c:281:error: too few arguments to function ‘ngx_sock_ntop’
make[1]: ***[objs/addon/nginx-sticky-module-1.1/ngx_http_sticky_misc.o] Error 1
make[1]: Leaving directory`/usr/local/nginx-1.7.4'
make: *** [build] Error 2



         解决方法

         进入nginx-sticky-module-1.1解压之后的文件夹

cd /usr/local/nginx-sticky-module-1.1


         编辑文件夹里面的ngx_http_sticky_module.c文件

vi ngx_http_sticky_module.c


         找到文件的地281行,做出如下修改

原digest->len =ngx_sock_ntop(in,digest
       ->data, len, 1);
改后digest->len =ngx_sock_ntop(in,sizeof(struct sockaddr_in),digest
       ->data, len, 1);

        

         后记

         今天状态不做,便把遇到的问题以及解决方法都稍微整理了一下,希望对读者有帮助,其实自己忘了,也能回来看看,一举两得。

目录
相关文章
|
1月前
|
应用服务中间件 网络安全 nginx
运维专题.Docker+Nginx服务器的SSL证书安装
运维专题.Docker+Nginx服务器的SSL证书安装
37 3
|
1月前
|
缓存 应用服务中间件 API
Nginx七层(应用层)反向代理:HTTP反向代理proxy_pass篇(三)
Nginx七层(应用层)反向代理:HTTP反向代理proxy_pass篇(三)
29 3
|
1月前
|
缓存 运维 应用服务中间件
运维系列.Nginx配置中的高级指令和流程控制
运维系列.Nginx配置中的高级指令和流程控制
30 1
|
1月前
|
缓存 安全 应用服务中间件
Nginx七层(应用层)反向代理:HTTP反向代理proxy_pass篇(二)
Nginx七层(应用层)反向代理:HTTP反向代理proxy_pass篇(二)
27 1
|
1月前
|
运维 算法 应用服务中间件
运维系列.Nginx中使用HTTP压缩功能(一)
运维系列.Nginx中使用HTTP压缩功能(一)
29 1
|
23天前
|
消息中间件 Kafka 网络安全
【Azure 应用服务】本地创建Azure Function Kafka Trigger 函数和Kafka output的HTTP Trigger函数实验
【Azure 应用服务】本地创建Azure Function Kafka Trigger 函数和Kafka output的HTTP Trigger函数实验
|
23天前
|
Python
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
|
24天前
|
JavaScript 前端开发 API
【Azure 应用服务】Azure Function HTTP 触发后, 230秒就超时。而其他方式触发的Function, 执行5分钟后也超时,如何调整超时时间?
【Azure 应用服务】Azure Function HTTP 触发后, 230秒就超时。而其他方式触发的Function, 执行5分钟后也超时,如何调整超时时间?
|
1月前
|
负载均衡 应用服务中间件 网络安全
Nginx七层(应用层)反向代理:HTTP反向代理proxy_pass篇(一)
Nginx七层(应用层)反向代理:HTTP反向代理proxy_pass篇(一)
41 0
|
1月前
|
缓存 应用服务中间件 nginx
运维系列.Nginx中使用HTTP压缩功能(二)
运维系列.Nginx中使用HTTP压缩功能(二)
27 0

热门文章

最新文章