Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding nginx-extra #154

Open
andrei93r opened this issue Nov 19, 2022 · 5 comments
Open

Adding nginx-extra #154

andrei93r opened this issue Nov 19, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@andrei93r
Copy link

Hi,

I saw that the following package https://packages.debian.org/bullseye/nginx-extras contains a lot of free extra utils on nginx. Was wondering if you can include it by default in your build ?

@JonasAlfredsson
Copy link
Owner

This has been asked once before, and there is some issues with downloading these packages via APT: #50

I have not had time to investigate this much further, but I will happily take any help I can get with figuring out how to include these extra packages in both the Debian and Alpine images :)

@JonasAlfredsson JonasAlfredsson added enhancement New feature or request help wanted Extra attention is needed labels Nov 20, 2022
@JonasAlfredsson
Copy link
Owner

JonasAlfredsson commented Dec 9, 2022

@jseparovic
Copy link

@JonasAlfredsson Thanks for the tip! Worked for me to add fancyindex https://gist.github.com/jseparovic/8e011326034b4c2c36a5d2787e69b3d4
Cheers!

@YannickLevadoux
Copy link

YannickLevadoux commented Sep 23, 2023

Based on @jseparovic previous comment I've added headers-more module to my setup like this :

FROM jonasal/nginx-certbot:4.3.0-nginx1.25.2 AS builder

ENV NGINX_VERSION 1.25.2
ENV HEADER_MORE_VERSION 0.33

RUN apt-get update &&  apt-get install --no-install-recommends --no-install-suggests -y \
  gnupg1 \
  ca-certificates \
  gcc \
  libc-dev \
  make \
  openssl\
  curl \
  gnupg \
  wget \
  libpcre3 libpcre3-dev \
  unzip \
  libghc-zlib-dev

RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
    wget "https://github.com/dvershinin/headers-more-nginx-module/archive/refs/tags/v${HEADER_MORE_VERSION}.zip" -O ngx-header-more-${HEADER_MORE_VERSION}.zip && \
    CONF_ARGS=$(nginx -V 2>&1 | sed -n -e 's/^.*arguments: //p') \
    tar -zxC /usr/src -f nginx.tar.gz && \
    unzip ngx-header-more-${HEADER_MORE_VERSION} -d /usr/src && \
    cd /usr/src/nginx-$NGINX_VERSION && \
    ./configure --with-compat $CONF_ARGS --add-dynamic-module=/usr/src/headers-more-nginx-module-${HEADER_MORE_VERSION} && \
    make && make install

FROM jonasal/nginx-certbot:4.3.0-nginx1.25.2

COPY --from=builder /usr/local/nginx/modules/ngx_http_headers_more_filter_module.so /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so

RUN { echo -n 'load_module modules/ngx_http_headers_more_filter_module.so;'; cat /etc/nginx/nginx.conf; } >/tmp/nginx.conf && mv -f /tmp/nginx.conf /etc/nginx/nginx.conf

EDIT : If you guys want to test it :
https://hub.docker.com/repository/docker/yannick7fr/nginx-certbot-custom/general

@JonasAlfredsson
Copy link
Owner

Very nice!
Glad to see that you were able to get this working.
It is a really big project, but one day it would be nice to create a separate pre-built container with all of these modules included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants