Skip to content

Commit

Permalink
add per and njs
Browse files Browse the repository at this point in the history
Signed-off-by: Zoey <[email protected]>
  • Loading branch information
Zoey2936 committed Jun 19, 2023
1 parent a859d9e commit b6bc0cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
28 changes: 12 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ARG NGINX_VER=1.25.1

WORKDIR /src
# Requirements
RUN apk add --no-cache ca-certificates build-base patch cmake git perl libtool autoconf automake \
libatomic_ops-dev zlib-dev luajit-dev pcre-dev linux-headers yajl-dev libxml2-dev lua5.1-dev
RUN apk add --no-cache ca-certificates build-base patch cmake git mercurial libtool autoconf automake \
libatomic_ops-dev zlib-dev luajit-dev pcre-dev linux-headers yajl-dev libxml2-dev libxslt-dev perl-dev lua5.1-dev
# Openssl
RUN git clone --recursive https://github.com/quictls/openssl --branch openssl-3.1.0+quic+locks /src/openssl
RUN cd /src/openssl && \
Expand All @@ -26,24 +26,22 @@ RUN git clone --recursive https://github.com/SpiderLabs/ModSecurity /src/ModSecu
RUN wget https://nginx.org/download/nginx-"$NGINX_VER".tar.gz -O - | tar xzC /src && \
mv /src/nginx-"$NGINX_VER" /src/nginx && \
wget https://raw.githubusercontent.com/nginx-modules/ngx_http_tls_dyn_size/master/nginx__dynamic_tls_records_1.25.1%2B.patch -O /src/nginx/1.patch && \
# wget https://github.com/angristan/nginx-autoinstall/raw/master/patches/nginx_hpack_push_with_http3.patch -O /src/nginx/2.patch && \
wget https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.23.0-resolver_conf_parsing.patch -O /src/nginx/3.patch && \
wget https://raw.githubusercontent.com/openresty/openresty/master/patches/nginx-1.23.0-resolver_conf_parsing.patch -O /src/nginx/2.patch && \
# wget https://github.com/angristan/nginx-autoinstall/raw/master/patches/nginx_hpack_push_with_http3.patch -O /src/nginx/3.patch && \
# sed -i "s|nginx/|nginx-proxy-manager/|g" /src/nginx/src/core/nginx.h && \
# sed -i "s|Server: nginx|Server: nginx-proxy-manager|g" /src/nginx/src/http/ngx_http_header_filter_module.c && \
# sed -i "s|<hr><center>nginx</center>|<hr><center>nginx-proxy-manager</center>|g" /src/nginx/src/http/ngx_http_special_response.c && \
cd /src/nginx && \
patch -p1 </src/nginx/1.patch && \
# patch -p1 </src/nginx/2.patch && \
patch -p1 </src/nginx/3.patch && \
patch -p1 </src/nginx/2.patch && \
# patch -p1 </src/nginx/3.patch && \
rm /src/nginx/*.patch && \
# modules
# git clone --recursive https://github.com/itoffshore/nginx-upstream-fair /src/nginx-upstream-fair && \
# git clone --recursive https://github.com/kyprizel/testcookie-nginx-module /src/testcookie-nginx-module && \
# git clone --recursive https://github.com/dvershinin/ngx_http_js_challenge_module /src/ngx_http_js_challenge_module && \
git clone --recursive https://github.com/google/ngx_brotli /src/ngx_brotli && \
git clone --recursive https://github.com/aperezdc/ngx-fancyindex /src/ngx-fancyindex && \
git clone --recursive https://github.com/GetPageSpeed/ngx_security_headers /src/ngx_security_headers && \
# hg clone http://hg.nginx.org/njs /src/njs && \
# git clone --recursive https://github.com/nginx-modules/ngx_http_limit_traffic_ratefilter_module /src/ngx_http_limit_traffic_ratefilter_module && \
hg clone http://hg.nginx.org/njs /src/njs && \
git clone --recursive https://github.com/vision5/ngx_devel_kit /src/ngx_devel_kit && \
git clone --recursive https://github.com/openresty/lua-nginx-module /src/lua-nginx-module && \
git clone --recursive https://github.com/SpiderLabs/ModSecurity-nginx /src/ModSecurity-nginx && \
Expand All @@ -68,13 +66,13 @@ RUN wget https://nginx.org/download/nginx-"$NGINX_VER".tar.gz -O - | tar xzC /sr
# --with-mail_ssl_module \
--with-stream \
# --with-stream_ssl_module \
# --with-stream_quic_module \
# --with-stream_realip_module \
# --with-stream_ssl_preread_module \
--with-http_v2_module \
# --with-http_v2_hpack_enc \
--with-http_v3_module \
--with-http_ssl_module \
--with-http_perl_module \
--with-http_realip_module \
--with-http_gunzip_module \
--with-http_addition_module \
Expand All @@ -83,13 +81,11 @@ RUN wget https://nginx.org/download/nginx-"$NGINX_VER".tar.gz -O - | tar xzC /sr
--add-module=/src/ngx_brotli \
--add-module=/src/ngx-fancyindex \
--add-module=/src/ngx_security_headers \
# --add-module=/src/njs/nginx \
# --add-module=/src/ngx_http_limit_traffic_ratefilter_module \
--add-module=/src/njs/nginx \
--add-module=/src/ngx_devel_kit \
--add-module=/src/lua-nginx-module \
--add-module=/src/ModSecurity-nginx && \
# --add-module=/src/nginx-upstream-fair \
# --add-module=/src/testcookie-nginx-module \
# --add-module=/src/ngx_http_js_challenge_module \
# Build & Install
make -j "$(nproc)" && \
make -j "$(nproc)" install && \
Expand All @@ -102,7 +98,7 @@ RUN wget https://nginx.org/download/nginx-"$NGINX_VER".tar.gz -O - | tar xzC /sr
FROM python:3.11.4-alpine3.18
COPY --from=build /usr/local/nginx /usr/local/nginx
COPY --from=build /usr/local/modsecurity/lib/libmodsecurity.so.3 /usr/local/modsecurity/lib/libmodsecurity.so.3
RUN apk add --no-cache ca-certificates tzdata zlib luajit pcre libstdc++ yajl libxml2 lua5.1-libs && \
RUN apk add --no-cache ca-certificates tzdata zlib luajit pcre libstdc++ yajl libxml2 libxslt perl lua5.1-libs && \
ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/nginx
ENTRYPOINT ["nginx"]
CMD ["-g", "daemon off;"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# nginx-quic
Docker image for Nginx + HTTP/3

Requires: `zlib luajit pcre libstdc++ yajl libxml2 lua5.1-libs`
Requires: `zlib luajit pcre libstdc++ yajl libxml2 libxslt perl lua5.1-libs` and libmodsecurity <br>
Please add: `/usr/local/nginx/lib/lua/?.lua;;` to the http part of your nginx.conf (replace /usr/local/nginx with the patch where you installed the tar file to)

0 comments on commit b6bc0cc

Please sign in to comment.