nginxにhttp/3を対応

nginxにhttp/3を対応ていうのはメインブログでも書きましたがこれはダウンロードページからshファイルを取得なので今はshファイルはないのでインストールできない。

nginxにhttp/3対応させるには

  • Boringssl
  • nginx-quic

が必要です。

先にBoringsslをインストールします。

必要なパッケージをインストール
yum -y update && yum -y groupinstall base && yum -y groupinstall development && yum -y install cmake3 pcre-devel zlib-devel golang hg
mkdir /opt/http3
cd /opt/http3
どちらでもいいです。
git clone https://boringssl.googlesource.com/boringssl
git clone https://github.com/google/boringssl.git
cd boringssl
mkdir build
cd build
cmake ..
make

nginxのほうをインストールします。

cd /opt/http3
hg clone -b quic https://hg.nginx.org/nginx-quic
cd nginx-quic
./auto/configure \
    --with-debug \
    --with-http_v2_module \
    --with-http_v3_module \
    --with-stream \
    --with-stream_quic_module \
    --with-http_ssl_module \
    --with-cc-opt="-I../boringssl/include"   \
    --with-ld-opt="-L../boringssl/build/ssl  \
                   -L../boringssl/build/crypto" \
    --prefix=/etc/nginx \
    --sbin-path=/usr/sbin/nginx \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --pid-path=/run/nginx.pid \
    --lock-path=/run/nginx.lock \
    --http-client-body-temp-path=/var/cache/nginx/client_temp \
    --http-proxy-temp-path=/var/cache/nginx/proxy_temp \
    --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
    --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
    --http-scgi-temp-path=/var/cache/nginx/scgi_temp \
    --user=nginx \
    --group=nginx
make
make install
useradd --shell /sbin/nologin nginx

これでインストールが完了しました。

わざわざhttp3に対応する必要はないとは思いますがhttp3に対応させたいと思うならやってみてもいいかもしれません。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です