1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| apt update && apt install build-essential ca-certificates zlib1g-dev libpcre3 libpcre3-dev tar unzip libssl-dev wget curl git cmake ninja-build hgsubversion
apt install software-properties-common -y add-apt-repository ppa:longsleep/golang-backports apt install golang go --version
git clone https://github.com/google/boringssl.git
cd boringssl/ mkdir build
cd build/ cmake -GNinja .. ninja
hg clone -b quic https://hg.nginx.org/nginx-quic
或者wget https://hg.nginx.org/nginx-quic/archive/quic.tar.gz tar xf quic.tar.gz cd nginx-quic-8057e053480a nginx -V ./auto/configure you nginx config --with-http_v3_module --with-stream_quic_module --with-cc-opt="-I../boringssl/include" --with-ld-opt="-L../boringssl/build/ssl -L../boringssl/build/crypto"
make -j$(nproc --all)
cp -af objs/nginx /sbin/nginx
vim /etc/nginx/conf.d/http3.conf server{ listen 443 quic reuseport; listen 443 ssl http2; server_name you domain name; ssl_certificate /you/path/you.pem; ssl_certificate_key /you/path/you.key; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; add_header alt-svc 'h3-23=":443"; ma=86400'; }
iptables -IINPUT -p udp --dport 443 -j ACCEPT iptables -IINPUT -p tcp --dport 443 -j ACCEPT
netstat -nupl
systemctl restart nginx
|