RUN set -ex; \ \ a2enmod headers 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; \ } > $APACHE_CONFDIR/conf-available/remoteip.conf; \ a2enconf remoteip RUN set -ex; \ APACHE_DOCUMENT_ROOT=/var/www/html/public; \ sed -ri -e "s!/var/www/html!${APACHE_DOCUMENT_ROOT}!g" $APACHE_CONFDIR/sites-available/*.conf; \ sed -ri -e "s!/var/www/!${APACHE_DOCUMENT_ROOT}!g" $APACHE_CONFDIR/apache2.conf $APACHE_CONFDIR/conf-available/*.conf