@@ -8,10 +8,11 @@ NGINX_DEVEL_KIT_URL="https://github.com/simpl/ngx_devel_kit/archive/v${NGINX_DEV
88LUA_URL=" https://github.com/openresty/lua-nginx-module/archive/v${LUA_MODULE_VERSION} .tar.gz"
99NGINX_CACHE_PURGE_URL=" https://github.com/FRiCKLE/ngx_cache_purge/archive/${NGINX_CACHE_PURGE_VERSION} .tar.gz"
1010NGINX_UPSTREAM_CHECK_URL=" https://github.com/yaoweibin/nginx_upstream_check_module/archive/master.tar.gz"
11+ MAXMIND_URL=" https://github.com/maxmind/geoip-api-c/releases/download/v${GEOIP_VERSION} /GeoIP-${GEOIP_VERSION} .tar.gz"
1112
1213BUILD_DEPENDENCIES=" gcc patch libc-dev make openssl-dev \
1314curl pcre-dev zlib-dev linux-headers luajit-dev \
14- gnupg libxslt-dev gd-dev perl-dev geoip-dev"
15+ gnupg libxslt-dev gd-dev perl-dev git geoip-dev ca-certificates "
1516
1617${WITH_DEBUG} && {
1718 EXTRA_ARGS=" ${EXTRA_ARGS} --with-debug"
@@ -21,6 +22,7 @@ mkdir -p ${NGINX_SETUP_DIR}
2122cd ${NGINX_SETUP_DIR}
2223
2324# build dependencies
25+ echo " install build-deps $BUILD_DEPENDENCIES "
2426apk add --no-cache --virtual .build-deps ${BUILD_DEPENDENCIES}
2527
2628# prepare ngx_devel_kit support
@@ -54,6 +56,12 @@ ${WITH_LUA} && {
5456 export LUAJIT_INC=/usr/include/luajit-2.1
5557}
5658
59+ # install geoip
60+ curl -fSL $MAXMIND_URL -o " ${NGINX_SETUP_DIR} /geoip_module.tar"
61+ tar -zxC " ${NGINX_SETUP_DIR} " -f " ${NGINX_SETUP_DIR} /geoip_module.tar"
62+ cd ${NGINX_SETUP_DIR} /GeoIP-${GEOIP_VERSION}
63+ ./configure && make && make check && make install
64+
5765# nginx user role
5866mkdir -p /var/www/nginx
5967addgroup -S ${NGINX_USER}
8795 --http-scgi-temp-path=${NGINX_TEMP_DIR} /scgi \
8896 --http-uwsgi-temp-path=${NGINX_TEMP_DIR} /uwsgi \
8997 --with-pcre-jit \
90- --with-ipv6 \
9198 --with-http_ssl_module \
9299 --with-http_stub_status_module \
93100 --with-http_realip_module \
103110 --with-http_sub_module \
104111 --with-http_flv_module \
105112 --with-http_mp4_module \
113+ --with-http_slice_module \
106114 --with-stream \
107115 --with-stream_ssl_module \
116+ --with-stream_ssl_preread_module \
117+ --with-stream_realip_module \
118+ --with-stream_geoip_module=dynamic \
108119 --with-mail \
109120 --with-mail_ssl_module \
110121 --with-threads \
111122 --with-file-aio \
123+ --with-compat \
112124 --with-http_xslt_module=dynamic \
113125 --with-http_image_filter_module=dynamic \
114126 --with-http_geoip_module=dynamic \
@@ -159,7 +171,7 @@ RUN_DEPENDENCIES="$( \
159171 | xargs -r apk info --installed \
160172 | sort -u \
161173) "
162-
174+ echo " install rundeps $RUN_DEPENDENCIES "
163175apk add --no-cache --virtual .nginx-rundeps $RUN_DEPENDENCIES
164176
165177# cleanup
0 commit comments