nginx: add support for MaxMind GeoIP2 databases

Signed-off-by: Javier Marcet <javier@marcet.info>
This commit is contained in:
Javier Marcet 2023-06-30 16:21:19 +02:00 committed by Christian Marangi
parent 78cbb0153b
commit 659fe23a90
1 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,7 @@ PKG_BUILD_FLAGS:=gc-sections
# 3rd-party modules
PKG_MOD_EXTRA := \
geoip2 \
lua \
rtmp \
dav-ext \
@ -198,6 +199,13 @@ define Package/nginx-mod-luci/install
$(INSTALL_BIN) ./files-luci-support/60_nginx-luci-support $(1)/etc/uci-defaults/60_nginx-luci-support
endef
define Download/nginx-mod-geoip2
VERSION:=1cabd8a1f68ea3998f94e9f3504431970f848fbf
URL:=https://github.com/leev/ngx_http_geoip2_module.git
MIRROR_HASH:=b4bd8517f6595f28e9cea5370045df476e0f7fa9ca3611d71ba85c518f1a7eda
PROTO:=git
endef
define Download/nginx-mod-headers-more
VERSION:=bea1be3bbf6af28f6aa8cf0c01c07ee1637e2bd0
URL:=https://github.com/openresty/headers-more-nginx-module.git
@ -423,6 +431,8 @@ $(eval $(call BuildModule,brotli,,ngx_http_brotli_filter ngx_http_brotli_static,
Add support for brotli compression module.))
$(eval $(call BuildModule,naxsi,,ngx_http_naxsi, \
Enable NAXSI module.))
$(eval $(call BuildModule,geoip2,+@NGINX_STREAM_CORE_MODULE +libmaxminddb,ngx_http_geoip2 ngx_stream_geoip2, \
Enable MaxMind GeoIP2 module.))
# TODO: remove after a transition period (together with pkg nginx-util):
# It is for smoothly substituting nginx and nginx-mod-luci-ssl (by nginx-ssl