From bddea6cad658ec9377307b27dbc783bb74aafbcd Mon Sep 17 00:00:00 2001 From: JoostVanDerSluis <44533996+JoostVanDerSluis@users.noreply.github.com> Date: Tue, 18 Oct 2022 11:21:49 +0200 Subject: [PATCH] [bitnami/matomo] Proxy host headers (#6969) * Implemented MATOMO_PROXY_HOST_HEADER Use the MATOMO_PROXY_HOST_HEADER environment variable to configure the proxy_host_headers-matomo setting Signed-off-by: JoostVanDerSluis <44533996+JoostVanDerSluis@users.noreply.github.com> * Documented MATOMO_PROXY_HOST_HEADER Signed-off-by: JoostVanDerSluis <44533996+JoostVanDerSluis@users.noreply.github.com> Signed-off-by: JoostVanDerSluis <44533996+JoostVanDerSluis@users.noreply.github.com> --- .../4/debian-11/rootfs/opt/bitnami/scripts/libmatomo.sh | 5 +++++ bitnami/matomo/README.md | 1 + 2 files changed, 6 insertions(+) diff --git a/bitnami/matomo/4/debian-11/rootfs/opt/bitnami/scripts/libmatomo.sh b/bitnami/matomo/4/debian-11/rootfs/opt/bitnami/scripts/libmatomo.sh index 73af952619ac..4966db7d15c3 100644 --- a/bitnami/matomo/4/debian-11/rootfs/opt/bitnami/scripts/libmatomo.sh +++ b/bitnami/matomo/4/debian-11/rootfs/opt/bitnami/scripts/libmatomo.sh @@ -159,6 +159,11 @@ EOF info "Configuring Matomo to check proxy_client_headers for client IP" ini-file set -s "General" -k "proxy_client_headers[]" -v "$MATOMO_PROXY_CLIENT_HEADER" "$MATOMO_CONF_FILE" fi + + if ! is_empty_value "$MATOMO_PROXY_HOST_HEADER"; then + info "Configuring Matomo to check proxy_host_headers for client IP" + ini-file set -s "General" -k "proxy_host_headers[]" -v "$MATOMO_PROXY_HOST_HEADER" "$MATOMO_CONF_FILE" + fi if is_boolean_yes "$MATOMO_ENABLE_ASSUME_SECURE_PROTOCOL"; then info "Configuring Matomo to always assume secure protocol" diff --git a/bitnami/matomo/README.md b/bitnami/matomo/README.md index debd38b147c9..d147bb3e611c 100644 --- a/bitnami/matomo/README.md +++ b/bitnami/matomo/README.md @@ -291,6 +291,7 @@ If you are connecting through a reverse proxy (https-to-http) and Matomo is not - `MATOMO_ENABLE_ASSUME_SECURE_PROTOCOL`: Enable 'assume_secure_protocol' in Matomo configuration file. Default: **no** - `MATOMO_ENABLE_FORCE_SSL`: Enable 'force_ssl' in Matomo configuration file. Default: **no** - `MATOMO_PROXY_CLIENT_HEADER`: Specify the the client IP HTTP Header. Usually 'HTTP_X_FORWARDED_FOR'. No defaults. + - `MATOMO_PROXY_HOST_HEADER`: Specify the the host IP HTTP Header. Usually 'HTTP_X_FORWARDED_HOST'. No defaults. ##### Example