I currently have the default Ninx 1.22 on my Debian Bookworm server, and since I need HTTP/3, I need to replace it with Nginx 1.25 which can support HTTP/3.
So I'm trying to build Nginx 1.25.3 from source with the same flags as the previous Nginx installation, plus HTTP/3. I downloaded BoringSSL
and built it, following this tutorial.
Then to get the previous compile flags on the current Nginx, I do nginx -V
, I remove the --with-http_perl_module=dynamic
flag (I guess we don't need Perl in 2023, right?), and I add the --with-http3-module
and --with-cc-opt="-I../boringssl/include" --with-ld-opt="-L../boringssl/build/ssl -L../boringssl/build/crypto"
flags, as explained in this tutorial.
So all in all my Nginx 1.25.3 build configuration command is:
./configure --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' \
--prefix=/usr/share/nginx \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=stderr \
--lock-path=/var/lock/nginx.lock \
--pid-path=/run/nginx.pid \
--modules-path=/usr/lib/nginx/modules \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-compat \
--with-debug \
--with-pcre-jit \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_auth_request_module \
--with-http_v2_module \
--with-http_dav_module \
--with-http_slice_module \
--with-threads \
--with-http_addition_module \
--with-http_flv_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_sub_module \
--with-mail_ssl_module \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-stream_realip_module \
--with-http_geoip_module=dynamic \
--with-http_image_filter_module=dynamic \
--with-http_xslt_module=dynamic \
--with-mail=dynamic \
--with-stream=dynamic \
--with-stream_geoip_module=dynamic \
--with-http_v3_module \
--with-cc-opt="-I../boringssl/include" \
--with-ld-opt="-L../boringssl/build/ssl -L../boringssl/build/crypto"
Build configuration with BoringSSL / OpenSSL QUIC seems successful, since I got this among the output:
...
checking for OpenSSL library ... found
checking for OpenSSL QUIC support ... found
checking for OpenSSL QUIC compatibility ... found
...
But then, the compilation fails when doing make
:
make -f objs/Makefile
make[1]: Entering directory '/root/nginx-1.25.3'
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I../boringssl/include -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I /usr/include/libxml2 -I objs \
-o objs/src/core/nginx.o \
src/core/nginx.c
In file included from src/core/ngx_core.h:87,
from src/core/nginx.c:9:
src/event/ngx_event_quic.h:16:10: fatal error: quiche.h: No such file or directory
16 | #include <quiche.h>
| ^~~~~~~~~~
compilation terminated.
make[1]: *** [objs/Makefile:531: objs/src/core/nginx.o] Error 1
make[1]: Leaving directory '/root/nginx-1.25.3'
make: *** [Makefile:10: build] Error 2
What's happening?