nginx 编译添加 ngx_http_proxy_connect_module 模块

复制代码
git clone https://github.com/chobits/ngx_http_proxy_connect_module.git
wget http://nginx.org/download/nginx-1.25.0.tar.gz
tar -xzvf nginx-1.25.0.tar.gz
cd nginx-1.25.0/
sudo patch -p1 < ../ngx_http_proxy_connect_module/patch/proxy_connect_rewrite_102101.patch
sudo ./configure  --with-http_ssl_module  --add-module=../ngx_http_proxy_connect_module
sudo make && sudo make install

安装后启动 nginx

复制代码
cd /usr/local/nginx/sbin
# 查看安装的模块
sudo ./nginx -V
# 启动
sudo ./nginx -s reload

网址输入 IP 即可访问了。

如果 Nginx报错:

nginx: error invalid PID number "" in "/run/nginx.pid"

nginx: error open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

解决办法:

复制代码
sudo ./nginx -c /usr/local/nginx/conf/nginx.conf
sudo ./nginx -s reload
相关推荐
XIAOHEZIcode8 小时前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220701 天前
如何搭建本地yum源(上)
运维
ping某2 天前
为什么 Nginx 明明监听了 80,转发后端时却用了 4xxxx 端口?
后端·nginx
霜落长河3 天前
抛弃TCP改用UDP,HTTP3怎么了?
http
大树884 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠4 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质4 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
Inhand陈工4 天前
基于台达PLC与映翰通IG502的智慧水产养殖精准投喂与远程运维解决方案
运维·人工智能·物联网·阿里云·信息与通信
酣大智4 天前
ARP代理--工作原理
运维·网络·arp·arp代理
shushangyun_4 天前
2026年快消品B2B系统推荐:支持终端门店订货、促销政策自动化的工具?
java·运维·网络·数据库·人工智能·spring·自动化