问下nginx如何安装一个正向代理的模块ngx_http_proxy_connect_module?
情况是这样的,我内部服务器需要通过一个外部服务器正向代理到 https 的网站,然后我在外部服务器安装了 nginx,然后 nginx 上需要安装一个模块 ngx_http_proxy_connect_module
但是我自己本地测试一直没安装成功,就问下大家有没有安装成功过的?我外部服务器系统是 ubuntu22.04
我用的 nginx 是刚刚从官网下载的 1.25.4
然后我 cd 到 nginx 的目录
然后我 patch -p1 < /root/ngx_http_proxy_connect_module/patch/proxy_connect.patch
然后我 ./configure –add-module=/root/ngx_http_proxy_connect_module
然后 make && make install
一切都运行正常。
然后我编辑 /usr/local/nginx/conf/nginx.conf
添加一个测试的 server
server {
listen 80;
proxy_connect;
proxy_connect_allow 443 80;
proxy_connect_read_timeout 10s;
proxy_connect_send_timeout 10s;
proxy_connect_connect_timeout 10s;
localtion / {
proxy_pass $scheme://$http_host$request_uri;
}
}
然后我启动 nginx,nginx -c /usr/local/nginx/conf/nginx.conf
然后就报了一个错误
nginx: [emerg] unknown directive "proxy_connect" in /usr/local/nginx/conf/nginx.conf:40
找不到那个模块
然后我执行:nginx -V
nginx version: nginx/1.25.4
built by gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
configure arguments: --add-module=/root/ngx_http_proxy_connect_module
有没有用过这个模块成功的?
推荐文章: