yeahwu / image

8 stars 1 forks source link

仅使用Nginx实现HTTPS正向代理 | 主机会话 #76

Open yeahwu opened 1 year ago

yeahwu commented 1 year ago

https://hostalk.net/posts/nginx_https_proxy.html

Nginx 正向 HTTPS 代理,需要插件 ngx_http_proxy_connect_module 支持,且需要 auth_basic 作为访问认证,但由于 auth_basic 模块只能处理 Authorization header,所以还要加入 lua-nginx-module 来处理Proxy-Authorization header 认证。

moosetk commented 1 year ago

终于出教程了,这是不是 gost -L http+tls 的重新实现?

imbalaomao commented 1 year ago

在实际操作的时候,编译nginx出现以下报错: make: *** No rule to make target 'build', needed by 'default'. Stop. 请问这是什么问题? 操作系统:Debian 11

yeahwu commented 1 year ago

@imbalaomao 在实际操作的时候,编译nginx出现以下报错: make: *** No rule to make target 'build', needed by 'default'. Stop. 请问这是什么问题? 操作系统:Debian 11

是不是依赖不完整,可以试试下面命令: apt update -y

apt install -y build-essential libtool libpcre3 libpcre3-dev zlib1g-dev openssl libssl-dev wget git

yeahwu commented 1 year ago

@moosetk 终于出教程了,这是不是 gost -L http+tls 的重新实现?

是的,效果是一样的

wwng2333 commented 1 year ago

在alpine下编译通过,工作正常,感谢lz分享

imbalaomao commented 1 year ago

@yeahwu

@imbalaomao 在实际操作的时候,编译nginx出现以下报错: make: *** No rule to make target 'build', needed by 'default'. Stop. 请问这是什么问题? 操作系统:Debian 11

是不是依赖不完整,可以试试下面命令: apt update -y

apt install -y build-essential libtool libpcre3 libpcre3-dev zlib1g-dev openssl libssl-dev wget git

依赖确认已经全部安装了,系统改为debian 10以后报同样的错误 更新 发现在make报错之前的一行错误:./configure: error: no /root/ngx_devel_kit/config was found,在检查之前的操作过后,发现是如下操作出错: source /etc/profile 之后需要先 cd /root 即回到LuaJIT所在目录下,然后再进行下载ngx_devel_kit等操作,使得LuaJIT与后续git clone的库同目录,则可以正常开始 makemake install 操作

yeahwu commented 1 year ago

@imbalaomao

@yeahwu

@imbalaomao 在实际操作的时候,编译nginx出现以下报错: make: *** No rule to make target 'build', needed by 'default'. Stop. 请问这是什么问题? 操作系统:Debian 11

是不是依赖不完整,可以试试下面命令: apt update -y apt install -y build-essential libtool libpcre3 libpcre3-dev zlib1g-dev openssl libssl-dev wget git

依赖确认已经全部安装了,系统改为debian 10以后报同样的错误 更新 发现在make报错之前的一行错误:./configure: error: no /root/ngx_devel_kit/config was found,在检查之前的操作过后,发现是如下操作出错: source /etc/profile 之后需要先 cd /root 即回到LuaJIT所在目录下,然后再进行下载ngx_devel_kit等操作,使得LuaJIT与后续git clone的库同目录,则可以正常开始 makemake install 操作

还有一个小问题,在 lua_package_path "/opt/nginx/lib/lua/?.lua;;"; 这一步操作,是需要修改哪个文件呢?我没有看懂文章内的描述。

nginx.conf 文件里已经添加了。

dubiao commented 1 year ago

使用这种透明代理IP会被墙吗?