From 2b6d282e9475006a4056e8fee6cc3ecc48df965e Mon Sep 17 00:00:00 2001 From: "M. Hamzah Khan" Date: Tue, 8 Jan 2019 15:40:49 +0000 Subject: [PATCH] Configure and enable mod_remoteip, and handle X-Forwarded-Proto header. --- contrib/docker/Dockerfile.apache | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/docker/Dockerfile.apache b/contrib/docker/Dockerfile.apache index 1bd5961e0..d541efa5b 100644 --- a/contrib/docker/Dockerfile.apache +++ b/contrib/docker/Dockerfile.apache @@ -17,7 +17,15 @@ RUN apt-get update \ && docker-php-ext-install pdo_mysql pcntl gd exif bcmath \ && pecl install imagick \ && docker-php-ext-enable imagick pcntl imagick gd exif \ - && a2enmod rewrite \ + && a2enmod rewrite remoteip \ + && {\ + echo RemoteIPHeader X-Real-IP ;\ + echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ + echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ + echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ + echo SetEnvIf X-Forwarded-Proto "https" HTTPS=on ;\ + } > /etc/apache2/conf-available/remoteip.conf \ + && a2enconf remoteip \ && curl -LsS https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar -o /usr/bin/composer \ && echo "${COMPOSER_CHECKSUM} /usr/bin/composer" | sha256sum -c - \ && chmod 755 /usr/bin/composer \