feat: add RemoteIPInternalProxy
All checks were successful
web/phpapache/pipeline/head This commit looks good

This commit is contained in:
Julien Cabillot 2023-05-30 17:48:06 -04:00
parent 377889e098
commit 4f425dfc3c

View File

@ -6,7 +6,7 @@ RUN export DEBIAN_FRONTEND="noninteractive" && \
sed -i'' 's/ServerSignature On/ServerSignature Off/; s/ServerTokens OS/ServerTokens Prod/' "/etc/apache2/conf-enabled/security.conf" && \ sed -i'' 's/ServerSignature On/ServerSignature Off/; s/ServerTokens OS/ServerTokens Prod/' "/etc/apache2/conf-enabled/security.conf" && \
sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \ sed -i'' 's/^Listen 80$/Listen 8080/' "/etc/apache2/ports.conf" && \
sed -i'' 's/^<VirtualHost \*:80>$/<VirtualHost *:8080>/' '/etc/apache2/sites-enabled/000-default.conf' && \ sed -i'' 's/^<VirtualHost \*:80>$/<VirtualHost *:8080>/' '/etc/apache2/sites-enabled/000-default.conf' && \
echo "RemoteIPHeader X-Forwarded-For\nRemoteIPProxiesHeader X-Forwarded-By" > "${APACHE_CONFDIR}/conf-available/remoteip.conf" && \ echo "RemoteIPHeader X-Forwarded-For\nRemoteIPProxiesHeader X-Forwarded-By\nRemoteIPInternalProxy 10.0.0.0/8\nRemoteIPInternalProxy 192.168.0.0/16\nRemoteIPInternalProxy 172.16.0.0/12" > "${APACHE_CONFDIR}/conf-available/remoteip.conf" && \
sed -i'' 's/\(LogFormat "%h.*combined\)/LogFormat "%a %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined/' "${APACHE_CONFDIR}/apache2.conf" && \ sed -i'' 's/\(LogFormat "%h.*combined\)/LogFormat "%a %l %u %t \\"%r\\" %>s %O \\"%{Referer}i\\" \\"%{User-Agent}i\\"" combined/' "${APACHE_CONFDIR}/apache2.conf" && \
a2enconf remoteip && \ a2enconf remoteip && \
a2enmod remoteip headers rewrite && \ a2enmod remoteip headers rewrite && \