Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: niiknow/docker-nginx-image-proxy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: build-3.1.0
Choose a base ref
...
head repository: niiknow/docker-nginx-image-proxy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 1, 2021

  1. fix startup and upgrade nginx

    noogen committed Dec 1, 2021
    Copy the full SHA
    10e548f View commit details

Commits on Dec 6, 2021

  1. update message

    noogen committed Dec 6, 2021
    Copy the full SHA
    4272e71 View commit details
  2. update spelling

    noogen committed Dec 6, 2021
    Copy the full SHA
    675901e View commit details

Commits on Jan 11, 2022

  1. Copy the full SHA
    b9376ec View commit details

Commits on Jul 28, 2022

  1. Copy the full SHA
    852421f View commit details

Commits on Sep 19, 2022

  1. add various cdn ips sync

    noogen committed Sep 19, 2022
    Copy the full SHA
    cbfd69b View commit details
  2. add stackpath cdn

    noogen committed Sep 19, 2022
    Copy the full SHA
    1e7d119 View commit details

Commits on Sep 20, 2022

  1. update geoip2

    noogen committed Sep 20, 2022
    Copy the full SHA
    0098e1b View commit details
  2. update docker

    noogen committed Sep 20, 2022
    Copy the full SHA
    983b244 View commit details

Commits on Sep 21, 2022

  1. update geolite

    noogen committed Sep 21, 2022
    Copy the full SHA
    815e1e0 View commit details

Commits on Sep 22, 2022

  1. fix realip header issue

    noogen committed Sep 22, 2022
    Copy the full SHA
    f3eda2c View commit details

Commits on Sep 27, 2022

  1. fix cdn ips

    noogen committed Sep 27, 2022
    Copy the full SHA
    fbc97bd View commit details
  2. fix geoip

    noogen committed Sep 27, 2022
    Copy the full SHA
    5b3be40 View commit details
  3. fix geoip

    noogen committed Sep 27, 2022
    Copy the full SHA
    eb12290 View commit details
  4. fix geoip behind proxy

    noogen committed Sep 27, 2022
    Copy the full SHA
    1f80088 View commit details
  5. update log

    noogen committed Sep 27, 2022
    Copy the full SHA
    159e2f0 View commit details

Commits on Sep 28, 2022

  1. update config

    noogen committed Sep 28, 2022
    Copy the full SHA
    ca4b741 View commit details
  2. be specific where config is

    noogen committed Sep 28, 2022
    Copy the full SHA
    2f121be View commit details
  3. default server name

    noogen committed Sep 28, 2022
    Copy the full SHA
    bfb3532 View commit details
  4. update config

    noogen committed Sep 28, 2022
    Copy the full SHA
    fd31152 View commit details
  5. update startup

    noogen committed Sep 28, 2022
    Copy the full SHA
    22ad66e View commit details
  6. update geoip2 update

    noogen committed Sep 28, 2022
    Copy the full SHA
    e4b8415 View commit details
  7. Copy the full SHA
    09bcc4d View commit details
  8. fix geoip2 download build

    noogen committed Sep 28, 2022
    Copy the full SHA
    e720f22 View commit details
  9. fix config

    noogen committed Sep 28, 2022
    Copy the full SHA
    1245596 View commit details
  10. fix includes

    noogen committed Sep 28, 2022
    Copy the full SHA
    b3e2293 View commit details

Commits on Feb 28, 2023

  1. Copy the full SHA
    179ed97 View commit details
  2. Copy the full SHA
    90e3b8e View commit details

Commits on Mar 1, 2023

  1. Merge pull request #31 from CoolCold/master

    fixing typo: service is not Redis, it's a Nginx
    noogen authored Mar 1, 2023
    Copy the full SHA
    69592e5 View commit details

Commits on Sep 5, 2023

  1. Copy the full SHA
    e656dec View commit details
  2. Copy the full SHA
    2a3db1f View commit details

Commits on Dec 13, 2023

  1. move files around

    noogen committed Dec 13, 2023
    Copy the full SHA
    9a6c935 View commit details
  2. update bunnycdn

    noogen committed Dec 13, 2023
    Copy the full SHA
    0313d43 View commit details
  3. fix build

    noogen committed Dec 13, 2023
    Copy the full SHA
    80252c8 View commit details
  4. update compose

    noogen committed Dec 13, 2023
    Copy the full SHA
    700b9d5 View commit details

Commits on Dec 14, 2023

  1. update geoip

    noogen committed Dec 14, 2023
    Copy the full SHA
    82e0743 View commit details

Commits on Sep 8, 2024

  1. Update README.md

    noogen authored Sep 8, 2024
    Copy the full SHA
    a449591 View commit details
  2. Update README.md

    noogen authored Sep 8, 2024
    Copy the full SHA
    50b2d76 View commit details
  3. Update README.md

    noogen authored Sep 8, 2024
    Copy the full SHA
    6e97de0 View commit details
  4. Update README.md

    noogen authored Sep 8, 2024
    Copy the full SHA
    5def0a0 View commit details

Commits on Sep 11, 2024

  1. Copy the full SHA
    d6c1ada View commit details

Commits on Oct 18, 2024

  1. update ngx_devel_kit repo url

    noogen authored Oct 18, 2024
    Copy the full SHA
    68db7cc View commit details
Showing with 1,502 additions and 405 deletions.
  1. +16 −15 Dockerfile
  2. +8 −4 README.md
  3. +35 −18 build/image_filter.patch
  4. +11 −3 build/ngx_http_image_filter_module.c
  5. +13 −6 build/ubuntu.sh
  6. +26 −8 docker-compose.yml
  7. +0 −9 files/etc/cron.daily/cleanup
  8. +19 −70 files/etc/nginx/cdn-ips.conf
  9. +0 −64 files/etc/nginx/cdn.conf
  10. +640 −0 files/etc/nginx/cdn/cdn-bunny.conf
  11. +21 −0 files/etc/nginx/cdn/cdn-bunny.py
  12. +25 −0 files/etc/nginx/cdn/cdn-cloudflare.conf
  13. +24 −0 files/etc/nginx/cdn/cdn-cloudflare.py
  14. +21 −0 files/etc/nginx/cdn/cdn-fastly.conf
  15. +18 −0 files/etc/nginx/cdn/cdn-fastly.py
  16. +15 −0 files/etc/nginx/geoipme.conf
  17. +32 −0 files/etc/nginx/geolite2.conf
  18. +5 −0 files/etc/nginx/geolite2/geoip2-download.sh
  19. +31 −0 files/etc/nginx/include/assets.conf
  20. +138 −0 files/etc/nginx/include/block-exploits.inc
  21. +3 −0 files/etc/nginx/include/force-ssl.conf
  22. +29 −0 files/etc/nginx/include/generic.common
  23. +30 −0 files/etc/nginx/include/letsencrypt-acme-challenge.conf
  24. +4 −1 files/etc/nginx/{sites-enabled → include}/proxy-hide-headers.common
  25. +7 −0 files/etc/nginx/include/proxy.conf
  26. +2 −0 files/etc/nginx/include/resolvers.conf
  27. +7 −0 files/etc/nginx/include/ssl-ciphers.conf
  28. +96 −0 files/etc/nginx/mime.types
  29. +50 −76 files/etc/nginx/nginx.new
  30. +34 −0 files/etc/nginx/sites-enabled/1-geoip.conf
  31. +42 −85 files/etc/nginx/sites-enabled/{server.conf → server-conf.example}
  32. +24 −0 files/root/bin/dummycert.sh
  33. +15 −11 files/root/bin/my-startup.sh
  34. +0 −31 files/root/bin/placeholder-ssl.sh
  35. +13 −4 files/sbin/my_init
  36. +48 −0 files/usr/share/nginx/html/index.html
31 changes: 16 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
FROM ubuntu:20.04 AS buildstep
FROM ubuntu:24.04 AS buildstep
ENV TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive \
NGINX_DEVEL_KIT_VERSION=0.3.1 NGINX_SET_MISC_MODULE_VERSION=0.32 \
NGINX_VERSION=1.20.1
NGINX_DEVEL_KIT_VERSION=0.3.3 NGINX_SET_MISC_MODULE_VERSION=0.33 \
NGINX_VERSION=1.26.2
ADD ./build/ /tmp/
RUN bash /tmp/ubuntu.sh


FROM ubuntu:20.04
FROM ubuntu:24.04
LABEL maintainer="noogen <friends@niiknow.org>"
ENV TERM=xterm container=docker DEBIAN_FRONTEND=noninteractive \
NGINX_VERSION=_1.20.1-1~focal_amd64.deb \
NGINX_DEBUG=-dbg${NGINX_VERSION}
NGINX_VERSION=_1.26.2-1~noble_arm64.deb

COPY --from=buildstep /usr/src/nginx/nginx${NGINX_VERSION} /tmp

RUN cd /tmp \
&& echo "\n\n* soft nofile 800000\n* hard nofile 800000\n\n" >> /etc/security/limits.conf \
&& apt-get update -y && apt-get upgrade -y --no-install-recommends --no-install-suggests \
&& apt-get install -y --no-install-recommends --no-install-suggests \
curl gpg-agent nano libgd3 gettext-base unzip rsync cron \
apt-transport-https software-properties-common \
ca-certificates \
&& apt-get install -y --no-install-recommends --no-install-suggests curl gpg-agent nano \
libgd3 gettext-base unzip rsync cron apt-transport-https software-properties-common \
ca-certificates libmaxminddb0 libmaxminddb-dev mmdb-bin python3-pip git \
&& dpkg --configure -a \
&& touch /var/log/cron.log \
&& curl -s https://nginx.org/keys/nginx_signing.key | apt-key add - \
&& curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add - \
&& cp /etc/apt/sources.list /etc/apt/sources.list.bak \
&& echo "deb http://nginx.org/packages/ubuntu/ focal nginx" | tee -a /etc/apt/sources.list \
&& echo "deb-src http://nginx.org/packages/ubuntu/ focal nginx" | tee -a /etc/apt/sources.list \
&& echo "deb http://nginx.org/packages/ubuntu/ noble nginx" | tee -a /etc/apt/sources.list \
&& echo "deb-src http://nginx.org/packages/ubuntu/ noble nginx" | tee -a /etc/apt/sources.list \
&& apt-get update -y \
&& dpkg -i nginx${NGINX_VERSION} \
&& apt-get install --no-install-recommends --no-install-suggests -y nginx-module-njs gettext-base \
&& rm -rf /etc/nginx/conf.d/default.conf \
&& mkdir -p /var/log/nginx \
&& mkdir -p /var/log/nginx /etc/nginx/ssl \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
&& service nginx stop && update-rc.d -f nginx disable \
&& pip3 install requests boto3 --break-system-packages \
&& apt-get clean -y && apt-get autoclean -y \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*
@@ -43,10 +42,12 @@ ADD ./files/etc/ /etc/
ADD ./files/root/ /root/
ADD ./files/sbin/ /sbin/

RUN bash /root/bin/placeholder-ssl.sh \
RUN bash /root/bin/dummycert.sh \
&& mkdir -p /app-start/etc \
&& mv /etc/nginx /app-start/etc/nginx \
&& rm -rf /etc/nginx \
&& cd /app-start/etc/nginx/geolite2 \
&& bash geoip2-download.sh \
&& ln -s /app/etc/nginx /etc/nginx \
&& mkdir -p /app-start/var/log \
&& mv /var/log/nginx /app-start/var/log/nginx \
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ Nginx module - https://github.com/niiknow/docker-nginx-image-proxy/blob/master/b

Original File - https://github.com/niiknow/docker-nginx-image-proxy/blob/master/build/src/http/modules/ngx_http_image_filter_module.c

Patch creation: `diff -u src/http/modules/ngx_http_image_filter_module.c ngx_http_image_filter_module.c > image_filter.patch`
Patch creation: `diff -u build/src/http/modules/ngx_http_image_filter_module.c build/ngx_http_image_filter_module.c > build/image_filter.patch`

Patch apply with: `patch src/http/modules/ngx_http_image_filter_module.c image_filter.patch`

@@ -35,10 +35,11 @@ image_filter_water_pos [ top-left | top-right | center | bottom-left | bottom-ri
# optional scale max ratio, default 1
# becareful not to set this too high or it will use too much memory.
#
# For example a 200KB JPEG file (1024x768) will take up 4MB of memory
# when loaded; but when resampled to twice the the size, the memory
# use jumps to 20.1MB
# For example (during testing) a 200KB JPEG file (1024x768) will take up 4MB of memory
# when loaded; but when resampled to twice (2x) of image size, the memory use jumps to 20.1MB
# Mathematically make sense: 4MB * 2(Dimensions xy) = 4MB * 2 * 2 = 16MB (new) + 4MB (original) = 20MB
image_filter_scale_max 3;

```

# What does this solve?
@@ -114,6 +115,9 @@ And if that doesn't work, you can always use your custom nginx config by passing
* Scale with watermark - http://imageproxy.niiknow.org/rx/2000,water_1/https://octodex.github.com/images/codercat.jpg
![Scale with watermark](http://imageproxy.niiknow.org/rx/2000,water_1/https://octodex.github.com/images/codercat.jpg)
# December 2021 Update
We're still using this project so maintenance and security update continues until further notice, but we're no longer adding new feature. We're also taking down example server so demo images above may not work in the future.
# Point of Interest
* [images.weserv.nl](https://github.com/weserv/images) is another great project to look at if you need additional features with image resizing. The original purpose of this library (nginx-image-proxy) is to provide high performance and low resource utilization image private microservice. We searched high and low but did not find a good solution. At that time, we saw great potential with images.weserv.nl, but was held back because it was using php. Since July 2018, it was rewritten with lua and direct c binding; as a result, it has became the next best solution and continue to improve. The authors also generiously provide free endpoint for public use. This help prove their implementation to be well battle-tested for use in any production environment.
> Update, as of September 2019, images.weserv.nl was rewritten again as C++ so it has now became the better/best choice. We are now sun-setting this project, only maintenance and security support - no new feature, for the future date of December 2021 or 2 years from December 2019.
53 changes: 35 additions & 18 deletions build/image_filter.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- src/http/modules/ngx_http_image_filter_module.c 2019-09-24 15:35:32.000000000 -0500
+++ ngx_http_image_filter_module.c 2019-09-24 15:38:46.000000000 -0500
--- build/src/http/modules/ngx_http_image_filter_module.c 2019-09-24 15:35:32.000000000 -0500
+++ build/ngx_http_image_filter_module.c 2022-01-11 12:32:00.000000000 -0600
@@ -10,7 +10,7 @@
#include <ngx_http.h>

@@ -324,7 +324,7 @@
if (!ctx->force
&& ctx->angle == 0
&& (ngx_uint_t) sx <= ctx->max_width
@@ -872,6 +1003,63 @@
@@ -872,6 +1003,65 @@

transparent:

@@ -376,6 +376,8 @@
+ }
+ }
+
+ // white background
+ // gdImageFill(dst, 0, 0, gdImageColorAllocate(dst, 255, 255, 255));
+ my_resize(src, dst);
+ // set the new original
+ gdImageDestroy(src);
@@ -388,7 +390,7 @@
gdImageColorTransparent(src, -1);

dx = sx;
@@ -901,7 +1089,23 @@
@@ -901,7 +1091,23 @@

resize = 0;

@@ -413,7 +415,18 @@
if ((ngx_uint_t) dx > ctx->max_width) {
dy = dy * ctx->max_width / dx;
dy = dy ? dy : 1;
@@ -989,7 +1193,9 @@
@@ -931,7 +1137,9 @@
gdImageAlphaBlending(dst, 0);
}

- gdImageCopyResampled(dst, src, 0, 0, 0, 0, dx, dy, sx, sy);
+ // gdImageFill(dst, 0, 0, gdImageColorAllocate(dst, 255, 255, 255));
+
+ gdImageCopyResampled(dst, src, 0, 0, 0, 0, ceil(dx), ceil(dy), sx, sy);

if (colors) {
gdImageTrueColorToPalette(dst, 1, 256);
@@ -989,7 +1197,9 @@
}
}

@@ -424,7 +437,7 @@

src = dst;

@@ -1016,8 +1222,24 @@
@@ -1016,8 +1226,24 @@
return NULL;
}

@@ -451,15 +464,15 @@

ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"image crop: %d x %d @ %d x %d",
@@ -1048,6 +1270,7 @@
@@ -1048,6 +1274,7 @@
}

gdImageInterlace(dst, (int) conf->interlace);
+ ngx_http_image_watermark(r, conf, dst);

out = ngx_http_image_out(r, ctx->type, dst, &size);

@@ -1122,6 +1345,20 @@
@@ -1122,6 +1349,20 @@
#endif
break;

@@ -480,7 +493,7 @@
default:
failed = "unknown image type";
break;
@@ -1171,14 +1408,37 @@
@@ -1171,14 +1412,37 @@
u_char *out;
ngx_int_t q;
ngx_http_image_filter_conf_t *conf;
@@ -520,7 +533,7 @@
q = ngx_http_image_filter_get_value(r, conf->jqcv, conf->jpeg_quality);
if (q <= 0) {
return NULL;
@@ -1195,13 +1455,11 @@
@@ -1195,13 +1459,11 @@

case NGX_HTTP_IMAGE_PNG:
out = gdImagePngPtr(img, size);
@@ -535,7 +548,7 @@
q = ngx_http_image_filter_get_value(r, conf->wqcv, conf->webp_quality);
if (q <= 0) {
return NULL;
@@ -1214,6 +1472,22 @@
@@ -1214,6 +1476,22 @@
#endif
break;

@@ -558,7 +571,7 @@
default:
failed = "unknown image type";
break;
@@ -1263,7 +1537,27 @@
@@ -1263,7 +1541,27 @@

n = ngx_atoi(value->data, value->len);

@@ -587,7 +600,7 @@
return (ngx_uint_t) n;
}

@@ -1299,9 +1593,13 @@
@@ -1299,9 +1597,13 @@
conf->jpeg_quality = NGX_CONF_UNSET_UINT;
conf->webp_quality = NGX_CONF_UNSET_UINT;
conf->sharpen = NGX_CONF_UNSET_UINT;
@@ -601,7 +614,7 @@

return conf;
}
@@ -1364,6 +1662,37 @@
@@ -1364,6 +1666,37 @@
ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
1 * 1024 * 1024);

@@ -639,7 +652,7 @@
return NGX_CONF_OK;
}

@@ -1662,6 +1991,66 @@
@@ -1662,6 +1995,66 @@
}


@@ -706,7 +719,7 @@
static ngx_int_t
ngx_http_image_filter_init(ngx_conf_t *cf)
{
@@ -1673,3 +2062,109 @@
@@ -1673,3 +2066,113 @@

return NGX_OK;
}
@@ -785,6 +798,10 @@
+ offset = (int)((requestedLength - calculatedLength) / 2);
+ }
+
+ if (offset < 0) {
+ offset = 0;
+ }
+
+ return (offset);
+}
+
@@ -797,10 +814,10 @@
+ int destinationY = destination->sy;
+
+ if (destinationRatio > originalRatio) {
+ destinationX = floor(destination->sy * originalRatio);
+ destinationX = ceil(destination->sy * originalRatio);
+ }
+ else {
+ destinationY = floor(destination->sx / originalRatio);
+ destinationY = ceil(destination->sx / originalRatio);
+ }
+
+ gdImageCopyResampled(
14 changes: 11 additions & 3 deletions build/ngx_http_image_filter_module.c
Original file line number Diff line number Diff line change
@@ -1051,6 +1051,8 @@ ngx_http_image_resize(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
}
}

// white background
// gdImageFill(dst, 0, 0, gdImageColorAllocate(dst, 255, 255, 255));
my_resize(src, dst);
// set the new original
gdImageDestroy(src);
@@ -1135,7 +1137,9 @@ ngx_http_image_resize(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
gdImageAlphaBlending(dst, 0);
}

gdImageCopyResampled(dst, src, 0, 0, 0, 0, dx, dy, sx, sy);
// gdImageFill(dst, 0, 0, gdImageColorAllocate(dst, 255, 255, 255));

gdImageCopyResampled(dst, src, 0, 0, 0, 0, ceil(dx), ceil(dy), sx, sy);

if (colors) {
gdImageTrueColorToPalette(dst, 1, 256);
@@ -2137,6 +2141,10 @@ static int my_offset(int calculatedLength, int requestedLength) {
offset = (int)((requestedLength - calculatedLength) / 2);
}

if (offset < 0) {
offset = 0;
}

return (offset);
}

@@ -2149,10 +2157,10 @@ static void my_resize (gdImagePtr original, gdImagePtr destination) {
int destinationY = destination->sy;

if (destinationRatio > originalRatio) {
destinationX = floor(destination->sy * originalRatio);
destinationX = ceil(destination->sy * originalRatio);
}
else {
destinationY = floor(destination->sx / originalRatio);
destinationY = ceil(destination->sx / originalRatio);
}

gdImageCopyResampled(
19 changes: 13 additions & 6 deletions build/ubuntu.sh
Original file line number Diff line number Diff line change
@@ -6,11 +6,14 @@ cd /tmp
apt-get update
apt-get install -y --no-install-recommends --no-install-suggests curl apt-transport-https \
apt-utils software-properties-common build-essential ca-certificates libssl-dev \
zlib1g-dev dpkg-dev libpcre3 libpcre3-dev libgd-dev gpg-agent
zlib1g zlib1g-dev dpkg-dev libpcre3 libpcre3-dev libgd-dev gpg-agent git

add-apt-repository ppa:maxmind/ppa
apt-get install -y libmaxminddb0 libmaxminddb-dev mmdb-bin

dpkg --configure -a

curl -sL "https://github.com/simplresty/ngx_devel_kit/archive/v$NGINX_DEVEL_KIT_VERSION.tar.gz" -o dev-kit.tar.gz
curl -sL "https://github.com/vision5/ngx_devel_kit/archive/v$NGINX_DEVEL_KIT_VERSION.tar.gz" -o dev-kit.tar.gz
mkdir -p /usr/src/nginx/ngx_devel_kit
tar -xof dev-kit.tar.gz -C /usr/src/nginx/ngx_devel_kit --strip-components=1
rm dev-kit.tar.gz
@@ -20,16 +23,20 @@ mkdir -p /usr/src/nginx/set-misc-nginx-module
tar -xof ngx-misc.tar.gz -C /usr/src/nginx/set-misc-nginx-module --strip-components=1
rm ngx-misc.tar.gz

curl -s https://nginx.org/keys/nginx_signing.key | apt-key add -
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb http://nginx.org/packages/ubuntu/ focal nginx" | tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/ubuntu/ focal nginx" | tee -a /etc/apt/sources.list
echo "deb http://nginx.org/packages/ubuntu/ noble nginx" | tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/ubuntu/ noble nginx" | tee -a /etc/apt/sources.list

apt-get update && apt-get upgrade -y --no-install-recommends --no-install-suggests

mkdir -p /usr/src/nginx

cd /usr/src/nginx
git clone https://github.com/leev/ngx_http_geoip2_module ngx_http_geoip2_module
curl -sL https://github.com/leev/ngx_http_geoip2_module/archive/master.tar.gz -o ngx_http_geoip2_module.tar.gz
tar zxvf ngx_http_geoip2_module.tar.gz
mv ngx_http_geoip2_module-master ngx_http_geoip2_module
apt-get source nginx=${NGINX_VERSION} -y

pwd
@@ -38,7 +45,7 @@ ls -la
cd ${NGINX_BUILD_DIR}
patch src/http/modules/ngx_http_image_filter_module.c /tmp/image_filter.patch

sed -i "s/--with-http_ssl_module/--with-http_ssl_module --with-http_image_filter_module --add-module=\/usr\/src\/nginx\/ngx_devel_kit --add-module=\/usr\/src\/nginx\/set-misc-nginx-module /g" \
sed -i "s/--with-http_ssl_module/--with-http_ssl_module --with-http_image_filter_module --add-module=\/usr\/src\/nginx\/ngx_http_geoip2_module --add-module=\/usr\/src\/nginx\/ngx_devel_kit --add-module=\/usr\/src\/nginx\/set-misc-nginx-module /g" \
${NGINX_BUILD_DIR}/debian/rules

cd /usr/src/nginx
Loading