Skip to content

Instantly share code, notes, and snippets.

@ficapy
Created November 20, 2015 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save ficapy/a70d5d05a9a216163dd3 to your computer and use it in GitHub Desktop.
Save ficapy/a70d5d05a9a216163dd3 to your computer and use it in GitHub Desktop.
Ubuntu/Debian HTTPS PROXY(nghttp2+squid3)
apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools
mkdir /nghttp2
git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
autoreconf -i
automake
autoconf
./configure
make
make install
echo lib > /etc/ld.so.conf.d/nghttp2.conf
ldconfig
nghttp -nv https://nghttp2.org
mkdir /etc/nghttpx
cd /etc/nghttpx
vi nghttpx.conf
###############################
frontend=0.0.0.0,443
backend=127.0.0.1,3128
private-key-file=/etc/nghttpx/www.key
certificate-file=/etc/nghttpx/www.crt
http2-proxy=yes
###############################
cp nghttpx-init /etc/init.d/nghttpx
cp nghttpx.service /lib/systemd/system/
service nghttpx start
netstat -apn
apt-get install -y squid
vi /etc/squid3/squid.conf
###############################
http_port 127.0.0.1:3128
http_access allow localhost
# 关闭缓存功能和日志功能
cache deny all
access_log none
# 优先访问 IPv4 站点,有完整 IPv6 支持的机器可以去掉
dns_v4_first on
# 不添加 Via 头
via off
# 删除 X-Forwarded-For 头
forwarded_for delete
###############################
service squid3 start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment