nginx配置新增模块后,安装失败
辛苦大大帮忙看看~~~~因需要在Nginx中代理https请求,需要编译进去这个模块:https://github.com/chobits/ngx_http_proxy_connect_module
当前nginx版本是1.16.1
我做了什么:
0、下载这个模块:
> cd /home
> git clone https://github.com/chobits/ngx_http_proxy_connect_module
1、lnmp.conf 配置 Nginx_Modules_Options='--add-module=/home/ngx_http_proxy_connect_module'
2、cd /home/lnmp1.6 && ./upgrade.sh nginx
选择1.16.1还是原来的版本,运行到最后提示:
make: *** 错误 1
make: 离开目录“/home/lnmp1.6/src/nginx-1.16.1”
make: *** 错误 2
cp: 无法获取"objs/nginx" 的文件状态(stat): 没有那个文件或目录
Test nginx configure file...
include/upgrade_nginx.sh:行72: /usr/local/nginx/sbin/nginx: 没有那个文件或目录
upgrade...
/usr/local/nginx/sbin/nginx -t
make: /usr/local/nginx/sbin/nginx:命令未找到
make: *** 错误 127
Checking ...
Error: Nginx upgrade failed.
在线等,急 贴一下完整的错误信息:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_handler’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1374:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method != NGX_HTTP_CONNECT || !plcf->accept_connect) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1374:22: 附注:每个未声明的标识符在其出现的函数内只报告一次
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1402:28: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.len = r->connect_host.len;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1403:29: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.data = r->connect_host.data;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1407:24: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.len = r->connect_host.len;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1408:25: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.data = r->connect_host.data;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1411:25: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
url.default_port = r->connect_port_n;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1456:53: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
u->resolved->port = (in_port_t) (url.no_port ? r->connect_port_n : url.port);
^
In file included from src/core/ngx_core.h:59:0,
from /home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:7:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1489:25: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
&r->connect_host);
^
src/core/ngx_log.h:86:67: 附注:in definition of macro ‘ngx_log_error’
if ((log)->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__)
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_allow_handler’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1565:39: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
if ((ports == 0 && r->connect_port_n == ports)
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1566:37: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
|| (ports <= r->connect_port_n && r->connect_port_n <= ports))
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1566:58: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
|| (ports <= r->connect_port_n && r->connect_port_n <= ports))
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1574:14: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
if (r->connect_port_n == 443 || r->connect_port_n == 563) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1574:42: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
if (r->connect_port_n == 443 || r->connect_port_n == 563) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_variable_get_time’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1926:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method != NGX_HTTP_CONNECT) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_variable_set_time’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1963:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method != NGX_HTTP_CONNECT) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_post_read_handler’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:2019:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method == NGX_HTTP_CONNECT) {
^
make: *** 错误 1
make: 离开目录“/home/lnmp1.6/src/nginx-1.16.1”
make: *** 错误 2
make -f objs/Makefile
make: 进入目录“/home/lnmp1.6/src/nginx-1.16.1”
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 /home/lnmp1.6/src/openssl-1.1.1d/.openssl/include -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/stream \
-o objs/addon/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.o \
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_handler’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1374:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method != NGX_HTTP_CONNECT || !plcf->accept_connect) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1374:22: 附注:每个未声明的标识符在其出现的函数内只报告一次
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1402:28: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.len = r->connect_host.len;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1403:29: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.data = r->connect_host.data;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1407:24: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.len = r->connect_host.len;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1408:25: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
url.url.data = r->connect_host.data;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1411:25: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
url.default_port = r->connect_port_n;
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1456:53: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
u->resolved->port = (in_port_t) (url.no_port ? r->connect_port_n : url.port);
^
In file included from src/core/ngx_core.h:59:0,
from /home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:7:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1489:25: 错误:‘ngx_http_request_t’没有名为‘connect_host’的成员
&r->connect_host);
^
src/core/ngx_log.h:86:67: 附注:in definition of macro ‘ngx_log_error’
if ((log)->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__)
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_allow_handler’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1565:39: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
if ((ports == 0 && r->connect_port_n == ports)
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1566:37: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
|| (ports <= r->connect_port_n && r->connect_port_n <= ports))
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1566:58: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
|| (ports <= r->connect_port_n && r->connect_port_n <= ports))
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1574:14: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
if (r->connect_port_n == 443 || r->connect_port_n == 563) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1574:42: 错误:‘ngx_http_request_t’没有名为‘connect_port_n’的成员
if (r->connect_port_n == 443 || r->connect_port_n == 563) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_variable_get_time’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1926:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method != NGX_HTTP_CONNECT) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_variable_set_time’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:1963:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method != NGX_HTTP_CONNECT) {
^
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c: 在函数‘ngx_http_proxy_connect_post_read_handler’中:
/home/ngx_http_proxy_connect_module/ngx_http_proxy_connect_module.c:2019:22: 错误:‘NGX_HTTP_CONNECT’未声明(在此函数内第一次使用)
if (r->method == NGX_HTTP_CONNECT) {
^
make: *** 错误 1
make: 离开目录“/home/lnmp1.6/src/nginx-1.16.1”
make: *** 错误 2
cp: 无法获取"objs/nginx" 的文件状态(stat): 没有那个文件或目录
Test nginx configure file...
include/upgrade_nginx.sh:行72: /usr/local/nginx/sbin/nginx: 没有那个文件或目录
upgrade...
/usr/local/nginx/sbin/nginx -t
make: /usr/local/nginx/sbin/nginx:命令未找到
make: *** 错误 127
Checking ...
Error: Nginx upgrade failed. 这是第三方模块,模块安装教程上就有说明:https://github.com/chobits/ngx_http_proxy_connect_module#install
不同nginx版本不同的patch,不是简单的加个模块目录就行,还得自己修改nginx升级脚本按格式先加上打patch的命令 licess 发表于 2019-11-30 16:45
这是第三方模块,模块安装教程上就有说明:https://github.com/chobits/ngx_http_proxy_connect_module#ins ...
已经解决了。
仔细点,看了一下upgrade_nginx.sh,加一行patch就行了。
感谢大佬回复。
页:
[1]