Skip to content

Commit 5cc85ef

Browse files
authored
Merge pull request #155 from VirtuBox/dev
Update Nginx stable and few improvements
2 parents 84f4797 + 77c6bdb commit 5cc85ef

File tree

5 files changed

+40
-118
lines changed

5 files changed

+40
-118
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased] - XX-XX-XX
88

9+
## [3.8.1] - 2024-04-24
10+
11+
### Changed
12+
13+
- Nginx stable release bumped to 1.26.0
14+
- HTTP/3 now available on both mainline and stable release
15+
- Always download latest zlib library if zlib-cf not supported
16+
- Always download the latest libressl release
17+
- HTTP/2 HPACK removed
18+
919
## [3.8.0] - 2024-04-23
1020

1121
### Added

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</h1>
88

99
<h4 align="center">
10-
Automated Nginx compilation from sources with additional modules support
10+
Automated Nginx compilation from sources with HTTP/3 QUIC and additional modules support
1111
</h4>
1212

1313
---
@@ -45,7 +45,7 @@ Automated Nginx compilation from sources with additional modules support
4545
* Nginx built-in modules selection
4646
* Nginx Third-party modules selection
4747
* Dynamic modules support
48-
* HTTP/3 QUIC Support with Mainline Release
48+
* HTTP/3 QUIC Support
4949
* Brotli Support
5050
* TLS v1.3 support
5151
* OpenSSL or LibreSSL
@@ -59,7 +59,7 @@ Automated Nginx compilation from sources with additional modules support
5959
## Additional Third-party modules
6060

6161
Nginx current mainline release : **v1.25.5** with HTTP/3 QUIC
62-
Nginx current stable release : **v1.24.0** with Cloudflare HTTP/2 HPACK
62+
Nginx current stable release : **v1.26.0** with HTTP/3 QUIC
6363

6464
* [ngx_cache_purge](https://github.com/FRiCKLE/ngx_cache_purge)
6565
* [headers-more-nginx-module](https://github.com/openresty/headers-more-nginx-module)
@@ -121,7 +121,7 @@ Optional modules :
121121

122122
### HTTP/3 QUIC
123123

124-
**Full support of HTTP/3 QUIC is only available with Nginx mainline release and compiled with LibreSSL**. More information [here](https://nginx.org/en/docs/http/ngx_http_v3_module.html).
124+
**Full support of HTTP/3 QUIC is only available with LibreSSL**. More information [here](https://nginx.org/en/docs/http/ngx_http_v3_module.html).
125125

126126
---
127127

@@ -158,7 +158,7 @@ bash <(wget -O - vtb.cx/nginx-ee || curl -sL vtb.cx/nginx-ee) --interactive
158158

159159
### Custom installation
160160

161-
Example : Nginx stable release HTTP/2 with naxsi
161+
Example : Nginx stable release HTTP/3 with naxsi
162162

163163
```bash
164164
bash <(wget -O - vtb.cx/nginx-ee || curl -sL vtb.cx/nginx-ee) --stable --naxsi
@@ -168,7 +168,7 @@ bash <(wget -O - vtb.cx/nginx-ee || curl -sL vtb.cx/nginx-ee) --stable --naxsi
168168

169169
Nginx build options :
170170

171-
* `--stable` : compile Nginx stable release with HTTP/2
171+
* `--stable` : compile Nginx stable release with HTTP/3
172172
* `--full` : Naxsi + RTMP
173173
* `--dynamic` : Compile Nginx modules as dynamic modules
174174
* `--noconf` : Compile Nginx without any configuring. Useful when you use devops tools like ansible.

docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Automated Nginx compilation from sources with additional modules support
4242
<li>Nginx built-in modules selection</li>
4343
<li>Nginx Third-party modules selection</li>
4444
<li>Dynamic modules support</li>
45-
<li>HTTP/3 QUIC Support with Mainline Release</li>
45+
<li>HTTP/3 QUIC Support</li>
4646
<li>Brotli Support</li>
4747
<li>TLS v1.3 support (Final)</li>
4848
<li>OpenSSL or LibreSSL</li>
@@ -52,8 +52,8 @@ Automated Nginx compilation from sources with additional modules support
5252
</ul>
5353
<hr />
5454
<h2 id="additional-third-party-modules">Additional Third-party modules</h2>
55-
<p>Nginx current mainline release : <strong>v1.25.5</strong> with HTTP/3 QUIC
56-
Nginx current stable release : <strong>v1.24.0</strong></p> with Cloudflare HTTP/2 HPACK
55+
<p>Nginx current mainline release : <strong>v1.25.5</strong> with HTTP/3 QUIC</p>
56+
<p>Nginx current stable release : <strong>v1.26.0</strong> with HTTP/3 QUIC</p>
5757
<ul>
5858
<li><a href="https://github.com/FRiCKLE/ngx_cache_purge">ngx_cache_purge</a></li>
5959
<li><a href="https://github.com/openresty/headers-more-nginx-module">headers-more-nginx-module</a></li>
@@ -109,7 +109,7 @@ Nginx current stable release : <strong>v1.24.0</strong></p> with Cloudflare HTTP
109109
<li>18.x (Obsidian)</li>
110110
</ul>
111111
<h3>### HTTP/3 QUIC</h3>
112-
<p><strong>Full support of HTTP/3 QUIC is only available with Nginx mainline release and compiled with LibreSSL**</strong>. More information [here](https://nginx.org/en/docs/http/ngx_http_v3_module.html).</p>
112+
<p><strong>Full support of HTTP/3 QUIC is only available with LibreSSL**</strong>. More information [here](https://nginx.org/en/docs/http/ngx_http_v3_module.html).</p>
113113

114114
<hr />
115115
<h2 id="usage">Usage</h2>
@@ -133,7 +133,7 @@ sudo bash nginx-build.sh
133133
<pre><code class="language-bash">bash &lt;(wget -O - vtb.cx/nginx-ee || curl -sL vtb.cx/nginx-ee) --interactive
134134
</code></pre>
135135
<h3 id="custom-installation">Custom installation</h3>
136-
<p>Example : Nginx stable release with HTTP/2 HPACK with naxsi</p>
136+
<p>Example : Nginx stable release with HTTP/3 with naxsi</p>
137137
<pre><code class="language-bash">bash &lt;(wget -O - vtb.cx/nginx-ee || curl -sL vtb.cx/nginx-ee) --stable --naxsi
138138
</code></pre>
139139
<h4 id="options-available">Options available</h4>

etc/nginx/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ http
3636

3737
server_tokens off;
3838
reset_timedout_connection on;
39-
add_header X-Powered-By "Nginx-ee v3.5.2 - Optimized by VirtuBox";
39+
add_header X-Powered-By "Nginx-ee v3.8.1 - Optimized by VirtuBox";
4040
add_header rt-Fastcgi-Cache $upstream_cache_status;
4141

4242
# Limit Request

nginx-build.sh

Lines changed: 18 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (c) 2019-2024 VirtuBox <[email protected]>
88
# This script is licensed under M.I.T
99
# -------------------------------------------------------------------------
10-
# Version 3.8.0 - 2024-04-23
10+
# Version 3.8.1 - 2024-04-24
1111
# -------------------------------------------------------------------------
1212

1313
##################################
@@ -26,7 +26,7 @@ _help() {
2626
echo " -------------------------------------------------------------------- "
2727
echo ""
2828
echo "Usage: ./nginx-ee <options> [modules]"
29-
echo "By default, Nginx-ee will compile the latest Nginx mainline release with HTTP/3 and without Naxsi or RTMP module"
29+
echo "By default, Nginx-ee will compile the latest Nginx mainline release without Naxsi or RTMP module"
3030
echo " Options:"
3131
echo " -h, --help ..... display this help"
3232
echo " -i, --interactive ....... interactive installation"
@@ -138,8 +138,8 @@ fi
138138
DIR_SRC="/usr/local/src"
139139
NGINX_EE_VER=$(curl -m 5 --retry 3 -sL https://api.github.com/repos/VirtuBox/nginx-ee/releases/latest 2>&1 | jq -r '.tag_name')
140140
NGINX_MAINLINE="$(curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o 'nginx\-[0-9.]+\.tar[.a-z]*' | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 1 2>&1)"
141-
NGINX_STABLE="$(curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o 'nginx\-[0-9.]+\.tar[.a-z]*' | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 2 | grep 1.24 2>&1)"
142-
LIBRESSL_VER="3.8.4"
141+
NGINX_STABLE="$(curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o 'nginx\-[0-9.]+\.tar[.a-z]*' | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 2 | grep 1.26 2>&1)"
142+
LIBRESSL_VER="$(curl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ 2>&1 | grep -E -o 'libressl\-[0-9.]+\.tar[.a-z]*' | awk -F "libressl-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | sort -r | head -n 1)"
143143
if command_exists openssl; then
144144
OPENSSL_BIN_VER=$(openssl version)
145145
OPENSSL_VER=${OPENSSL_BIN_VER:0:15}
@@ -150,7 +150,6 @@ TLS13_CIPHERS="TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+CHAC
150150
readonly OS_ARCH="$(uname -m)"
151151
OS_DISTRO_FULL="$(lsb_release -ds)"
152152
readonly DISTRO_ID="$(lsb_release -si)"
153-
readonly DISTRO_CODENAME="$(lsb_release -sc)"
154153

155154
# Colors
156155
CSI='\033['
@@ -206,9 +205,7 @@ if [ "$INTERACTIVE_SETUP" = "1" ]; then
206205
while [[ "$SSL_LIB_CHOICE" != "1" && "$SSL_LIB_CHOICE" != "2" ]]; do
207206
echo -e "Select an option [1-2]: " && read -r SSL_LIB_CHOICE
208207
done
209-
if [ "$SSL_LIB_CHOICE" = "1" ]; then
210-
OPENSSL_LIB=3
211-
else
208+
if [ "$SSL_LIB_CHOICE" = "2" ]; then
212209
LIBRESSL="y"
213210
fi
214211
echo -e '\nDo you want NAXSI WAF (still experimental)? (y/n)'
@@ -236,11 +233,9 @@ fi
236233

237234
if [ "$NGINX_RELEASE" = "2" ]; then
238235
NGINX_VER="$NGINX_STABLE"
239-
NGX_HPACK="--with-http_v2_hpack_enc"
240-
NGX_QUIC=""
236+
NGX_QUIC="--with-http_v3_module"
241237
else
242238
NGINX_VER="$NGINX_MAINLINE"
243-
NGX_HPACK=""
244239
NGX_QUIC="--with-http_v3_module"
245240
fi
246241

@@ -285,7 +280,6 @@ else
285280
OPENSSL_OPT="enable-tls1_3"
286281
fi
287282
fi
288-
QUIC_VALID="NO"
289283
NGX_SSL_LIB=""
290284
OPENSSL_VALID="from system"
291285
LIBSSL_DEV="libssl-dev"
@@ -323,20 +317,13 @@ echo ""
323317
echo -e " - Nginx release : $NGINX_VER"
324318
[ -n "$OPENSSL_VALID" ] && {
325319
echo -e " - OPENSSL : $OPENSSL_VER"
326-
if [ "$NGINX_RELEASE" = "2" ]; then
327-
echo -e " - HTTP/2 HPACK : YES"
328-
else
329-
echo -e " - with HTTP/3 : YES"
330-
fi
320+
echo -e " - with HTTP/3 : YES"
331321

332322
}
333323
[ -n "$LIBRESSL_VALID" ] && {
334324
echo -e " - LIBRESSL : $LIBRESSL_VALID"
335-
if [ "$NGINX_RELEASE" = "2" ]; then
336-
echo -e " - HTTP/2 HPACK : YES"
337-
else
338-
echo -e " - HTTP/3 QUIC : YES"
339-
fi
325+
echo -e " - HTTP/3 QUIC : YES"
326+
340327
}
341328
echo " - Dynamic modules $DYNAMIC_MODULES_VALID"
342329
echo " - Naxsi : $NAXSI_VALID"
@@ -471,10 +458,8 @@ _dynamic_setup() {
471458
}
472459

473460
##################################
474-
# Install gcc7 or gcc8 from PPA
461+
# Install gcc
475462
##################################
476-
# gcc7 if Nginx is compiled with RTMP module
477-
# otherwise gcc8 is used
478463

479464
_gcc_setup() {
480465
echo -ne ' Installing gcc [..]\r'
@@ -529,12 +514,12 @@ _download_modules() {
529514
echo -ne ' Downloading additionals modules [..]\r'
530515
if {
531516
echo "### downloading additionals modules ###"
532-
MODULES='FRiCKLE/ngx_cache_purge openresty/memc-nginx-module
517+
MODULES='openresty/memc-nginx-module
533518
simpl/ngx_devel_kit openresty/headers-more-nginx-module
534519
openresty/echo-nginx-module yaoweibin/ngx_http_substitutions_filter_module
535520
openresty/redis2-nginx-module openresty/srcache-nginx-module
536521
openresty/set-misc-nginx-module sto/ngx_http_auth_pam_module
537-
vozlt/nginx-module-vts centminmod/ngx_http_redis'
522+
vozlt/nginx-module-vts centminmod/ngx_http_redis nginx-modules/ngx_cache_purge'
538523
for MODULE in $MODULES; do
539524
_gitget "$MODULE"
540525
done
@@ -589,9 +574,9 @@ _download_zlib() {
589574
echo "### configure zlib-cf ###"
590575
./configure --prefix=/usr/local/zlib-cf
591576
else
592-
echo "### downloading zlib 1.2.13 ###"
577+
echo "### downloading zlib latest ###"
593578
rm -rf zlib
594-
curl -sL http://zlib.net/zlib-1.2.13.tar.gz | /bin/tar zxf - -C "$DIR_SRC"
579+
curl -sL http://zlib.net/current/zlib.tar.gz | /bin/tar zxf - -C "$DIR_SRC"
595580
mv zlib-1.2.13 zlib
596581
fi
597582

@@ -633,67 +618,6 @@ _download_brotli() {
633618

634619
}
635620

636-
##################################
637-
# Download and patch OpenSSL
638-
##################################
639-
640-
_download_openssl_dev() {
641-
642-
cd "$DIR_SRC" || exit 1
643-
if {
644-
echo -ne ' Downloading openssl [..]\r'
645-
646-
{
647-
if [ -d /usr/local/src/openssl ]; then
648-
if [ ! -d /usr/local/src/openssl/.git ]; then
649-
echo "### removing openssl extracted archive ###"
650-
rm -rf /usr/local/src/openssl
651-
echo "### cloning openssl ###"
652-
git clone --depth=50 https://github.com/openssl/openssl.git /usr/local/src/openssl
653-
cd /usr/local/src/openssl || exit 1
654-
echo "### git checkout commit ###"
655-
#git checkout $OPENSSL_COMMIT
656-
else
657-
cd /usr/local/src/openssl || exit 1
658-
echo "### reset openssl to master and clean patches ###"
659-
git fetch --all
660-
git reset --hard origin/master
661-
git clean -f
662-
#git checkout $OPENSSL_COMMIT
663-
fi
664-
else
665-
echo "### cloning openssl ###"
666-
git clone --depth=50 https://github.com/openssl/openssl.git /usr/local/src/openssl
667-
cd /usr/local/src/openssl || exit 1
668-
echo "### git checkout commit ###"
669-
#git checkout $OPENSSL_COMMIT
670-
fi
671-
} >>/tmp/nginx-ee.log 2>&1
672-
673-
{
674-
if [ -d /usr/local/src/openssl-patch/.git ]; then
675-
cd /usr/local/src/openssl-patch || exit 1
676-
git pull origin master
677-
else
678-
git clone --depth=50 https://github.com/VirtuBox/openssl-patch.git /usr/local/src/openssl-patch
679-
fi
680-
cd /usr/local/src/openssl || exit 1
681-
# apply openssl ciphers patch
682-
echo "### openssl ciphers patch ###"
683-
#patch -p1 <../openssl-patch/openssl-equal-3.0.0-dev_ciphers.patch
684-
} >>/tmp/nginx-ee.log 2>&1
685-
686-
}; then
687-
echo -ne " Downloading openssl [${CGREEN}OK${CEND}]\\r"
688-
echo -ne '\n'
689-
else
690-
echo -e " Downloading openssl [${CRED}FAIL${CEND}]"
691-
echo -e '\n Please look at /tmp/nginx-ee.log\n'
692-
exit 1
693-
fi
694-
695-
}
696-
697621
##################################
698622
# Download LibreSSL
699623
##################################
@@ -706,8 +630,8 @@ _download_libressl() {
706630

707631
{
708632
rm -rf /usr/local/src/libressl
709-
curl -sL http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${LIBRESSL_VER}.tar.gz | /bin/tar xzf - -C "$DIR_SRC"
710-
mv /usr/local/src/libressl-${LIBRESSL_VER} /usr/local/src/libressl
633+
curl -sL "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$LIBRESSL_VER.tar.gz" | /bin/tar xzf - -C "$DIR_SRC"
634+
mv "/usr/local/src/libressl-$LIBRESSL_VER" /usr/local/src/libressl
711635
} >>/tmp/nginx-ee.log 2>&1
712636

713637
}; then
@@ -789,12 +713,7 @@ _patch_nginx() {
789713
echo -ne ' Applying nginx patches [..]\r'
790714

791715
{
792-
if [ "$NGINX_RELEASE" = "2" ]; then
793-
curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_for_1.23.4.patch | patch -p1
794-
else
795-
curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_dynamic_tls_records.patch | patch -p1
796-
fi
797-
#curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_auto_using_PRIORITIZE_CHACHA.patch | patch -p1
716+
curl -sL https://raw.githubusercontent.com/kn007/patch/master/nginx_dynamic_tls_records.patch | patch -p1
798717
} >>/tmp/nginx-ee.log 2>&1
799718

800719
}; then
@@ -897,7 +816,6 @@ _configure_nginx() {
897816
$NGX_USER \
898817
--with-file-aio \
899818
--with-threads \
900-
$NGX_HPACK \
901819
$NGX_QUIC \
902820
--with-http_v2_module \
903821
--with-http_ssl_module \
@@ -1125,13 +1043,7 @@ fi
11251043
if [ "$LIBRESSL" = "y" ]; then
11261044
_download_libressl
11271045
else
1128-
if [ "$OPENSSL_LIB" = "2" ]; then
1129-
_download_openssl_dev
1130-
elif [ "$OPENSSL_LIB" = "3" ]; then
1131-
sleep 1
1132-
else
1133-
sleep 1
1134-
fi
1046+
sleep 1
11351047
fi
11361048
_download_nginx
11371049
_patch_nginx

0 commit comments

Comments
 (0)