用户工具

站点工具


xnix:nghttpx_http2_tls_proxy

使用 nghttpx 搭建一个 HTTPS PROXY

背景介绍: nghttpx+3proxy做https proxy, 其中3proxy的http proxy监听地址为127.0.0.1:12344

本案例, 将nghttpx监听在所有地址的12345端口.

在 FreeBSD 中, nghttpx 位于 ports 的 www/nghttp2. 如果需要ocsp, 务必同时安装python

配置文件如下

daemon=yes
user=www
frontend=*,12345
backend=127.0.0.1,12344
backend-connections-per-host=1024
fastopen=1024
http2-proxy=yes
npn-list=http/1.1
#frontend-http2-window-size=8M
#frontend-http2-connection-window-size=2M
server-name=
tls-no-postpone-early-data=yes
no-via=yes
dh-param-file=/usr/local/etc/ssl/dh.pem
certificate-file=/usr/local/etc/ssl/fullchain.pem
private-key-file=/usr/local/etc/ssl/privkey.pem
no-ocsp=yes

附件为 FreeBSD 的启动脚本 nghttpx_multi

20200130 更新

由于实测h2 proxy的速度不如http/1.1的, 特别是上行速度非常低, 所以上述配置文件直接禁用了h2的npn, 强制服务端只允许http/1.1

20250419 更新

禁用了 OCSP, OCSP 要废弃了.

xnix/nghttpx_http2_tls_proxy.txt · 最后更改: 2025/04/19 01:37 由 Hshh