From 32f84e61f0021c195b44b7ae2f1724edfbf5b7ef Mon Sep 17 00:00:00 2001 From: Ricardo Katz Date: Wed, 11 Oct 2023 23:46:23 +0000 Subject: [PATCH] Add AJP as dynamic for v1.8 --- rootfs/Dockerfile | 5 +++++ rootfs/Dockerfile-chroot | 5 +++++ rootfs/etc/nginx/template/nginx.tmpl | 2 ++ 3 files changed, 12 insertions(+) diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 75cf3fc65..51c56cc24 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -14,6 +14,9 @@ ARG BASE_IMAGE +# Source at https://github.com/rikatz/nginx-build-ajp +FROM docker.io/rpkatz/nginx-ajp-module:latest@sha256:1511f4abc7e1d56219abb4140ff279a9622f820208eaa934b0ee5e7b0ae974de as ajp + FROM ${BASE_IMAGE} ARG TARGETARCH @@ -76,6 +79,8 @@ RUN apk add --no-cache libcap \ && apk del libcap \ && ln -sf /usr/local/nginx/sbin/nginx /usr/bin/nginx +COPY --from=ajp /ngx_http_ajp_module.so /etc/nginx/modules + USER www-data # Create symlinks to redirect nginx logs to stdout and stderr docker log collector diff --git a/rootfs/Dockerfile-chroot b/rootfs/Dockerfile-chroot index 48facd44f..0874831cb 100644 --- a/rootfs/Dockerfile-chroot +++ b/rootfs/Dockerfile-chroot @@ -14,6 +14,9 @@ ARG BASE_IMAGE +# Source at https://github.com/rikatz/nginx-build-ajp +FROM docker.io/rpkatz/nginx-ajp-module:latest@sha256:1511f4abc7e1d56219abb4140ff279a9622f820208eaa934b0ee5e7b0ae974de as ajp + FROM ${BASE_IMAGE} as chroot # This intermediary image will be used only to copy all the required files to the chroot @@ -97,6 +100,8 @@ RUN apk add --no-cache libcap \ && setcap -v cap_sys_chroot,cap_net_bind_service=+ep /usr/bin/dumb-init \ && apk del libcap +COPY --from=ajp /ngx_http_ajp_module.so /etc/nginx/modules + RUN ln -sf /chroot/etc/nginx /etc/nginx \ && ln -sf /chroot/tmp/nginx /tmp/nginx \ && ln -sf /chroot/etc/ingress-controller /etc/ingress-controller \ diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl index 69e6195a2..b9ed4b98c 100644 --- a/rootfs/etc/nginx/template/nginx.tmpl +++ b/rootfs/etc/nginx/template/nginx.tmpl @@ -12,6 +12,8 @@ # setup custom paths that do not require root access pid {{ .PID }}; +load_module /etc/nginx/modules/ngx_http_ajp_module.so; + {{ if $cfg.UseGeoIP2 }} load_module /etc/nginx/modules/ngx_http_geoip2_module.so; {{ end }}