From da6790561ed35fc6f6cbc16b61be8b7b6b39bd32 Mon Sep 17 00:00:00 2001 From: Nicholas Bentley Date: Tue, 27 Feb 2024 17:32:41 -0500 Subject: [PATCH] add nginx_http_geoip2 module to openresty build --- docker/Dockerfile | 3 ++- scripts/build-openresty | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f3848e8..18c8b57 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,7 +19,8 @@ RUN apt-get update \ openssl unzip \ wget \ zlib1g-dev \ - git + git \ + libmaxminddb-dev # Lua build COPY ./scripts/build-lua /tmp/build-lua diff --git a/scripts/build-openresty b/scripts/build-openresty index 3019542..9f3a1bb 100755 --- a/scripts/build-openresty +++ b/scripts/build-openresty @@ -6,12 +6,14 @@ YELLOW='\E[1;33m' GREEN='\E[1;32m' RESET='\E[0m' -echo -e "${BLUE}❯ ${CYAN}Building OpenResty ${YELLOW}${OPENRESTY_VERSION}...${RESET}" +echo -e "${BLUE}❯ ${CYAN}Building OpenResty ${YELLOW}${OPENRESTY_VERSION} with nginx_http_geoip2 module...${RESET}" cd /tmp wget "https://openresty.org/download/openresty-${OPENRESTY_VERSION}.tar.gz" tar -xzf openresty-${OPENRESTY_VERSION}.tar.gz mv /tmp/openresty-${OPENRESTY_VERSION} /tmp/openresty +git clone https://github.com/leev/ngx_http_geoip2_module.git +mv /tmp/ngx_http_geoip2_module /tmp/openresty/ngx_http_geoip2_module cd /tmp/openresty ./configure \ @@ -52,7 +54,8 @@ cd /tmp/openresty --with-stream \ --with-stream_realip_module \ --with-stream_ssl_module \ - --with-stream_ssl_preread_module + --with-stream_ssl_preread_module \ + --add-dynamic-module=/tmp/openresty/ngx_http_geoip2_module make -j2