Vielleicht ist es keine eine Frage, aber vielleicht hat der ein oder andere mal mit dem Gedanken gespielt QUIC bzw. HTTP/3 auszuprobieren.
NGINX
Code
# Einmalig notwendig
apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libxslt1-dev libgd-dev libgeoip-dev uuid-dev git cmake ninja-build golang libunwind-dev
# Google PageSpeed
NPS_VERSION=1.14.33.1-RC1
cd
wget https://github.com/apache/incubator-pagespeed-ngx/archive/v${NPS_VERSION}.zip
unzip v${NPS_VERSION}.zip
nps_dir=$(find . -name "*pagespeed-ngx-${NPS_VERSION}" -type d)
cd "$nps_dir"
NPS_RELEASE_NUMBER=${NPS_VERSION/beta/}
NPS_RELEASE_NUMBER=${NPS_VERSION/stable/}
psol_url=https://dl.google.com/dl/page-speed/psol/${NPS_RELEASE_NUMBER}.tar.gz
[ -e scripts/format_binary_url.sh ] && psol_url=$(scripts/format_binary_url.sh PSOL_BINARY_URL)
wget ${psol_url}
tar -xzvf $(basename ${psol_url}) # extracts to psol/
# BoringSSL
cd
git clone https://boringssl.googlesource.com/boringssl boringssl
cd boringssl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -GNinja ../
ninja
# Brotli
cd
git clone https://github.com/google/ngx_brotli.git ngx_brotli
# NGINX Quic Branch
cd
hg clone -b quic https://hg.nginx.org/nginx-quic
cd /root/ngx_brotli && git submodule update --init && cd /root/nginx-quic
cd nginx-quic
CFLAGS="-Wno-ignored-qualifiers" ./auto/configure --prefix=/usr/local/nginx \
--sbin-path=/usr/sbin/nginx \
--add-module=$HOME/$nps_dir ${PS_NGX_EXTRA_FLAGS} \
--add-module=/root/ngx_brotli \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/lock/subsys/nginx \
--with-stream \
--with-threads \
--with-file-aio \
--with-stream_ssl_preread_module \
--with-http_secure_link_module \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_v3_module \
--with-http_quic_module \
--with-stream_quic_module \
--with-cc-opt="-I/root/boringssl/include $(CFLAGS)" \
--with-ld-opt="-L/root/boringssl/build/ssl \
-L/root/boringssl/build/crypto $(LDFLAGS)" \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module
make
make install
Alles anzeigen
Natürlich brauchen wir noch ein entsprechendes Systemctl Skript (z.B. unter "/lib/systemd/system/"):
Code
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Alles anzeigen
Danach nochmal kurz Systemctl reloaden und NGINX starten:
Eure entsprechenden Konfigurationsdateien passt ihr wie folgt an:
Code
listen 443 http3 quic reuseport;
listen 443 ssl http2;
add_header alt-svc 'h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400';
add_header Alt-Svc 'quic=":443"';
add_header QUIC-Status $quic;
quic_retry on;
ssl_early_data on;
Hinweis
Leider ist es notwendig BoringSSL für QUIC-Support zu nutzen, weshalb OCSP Stapling nicht unterstützt wird.
Es gibt zwar einen Patch auf GitHub, jedoch habe ich noch keinen Versuch unternommen diesen anzuwenden.