2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2025-12-07 22:07:09 +01:00

Now with apache AND fpm images variants client IP logging

This commit is contained in:
m33 2025-02-08 20:42:54 +01:00
commit e7a5c33069

View file

@ -150,8 +150,13 @@ RUN set -ex; \
} > /usr/local/etc/php/conf.d/friendica.ini; \
ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini; \
\
# Only append this client IP log settings to FPM image variants
if [ "%%VARIANT%%" != "apache" ]; then echo 'access.format = "%{HTTP_X_FORWARDED_FOR}e - %u %t \"%m %r\" %s"' 1>> /usr/local/etc/php-fpm.d/docker.conf; fi; \
# Set remote client IP logging for apache and fpm image variants
if [ "%%VARIANT%%" != "apache" ]; then \
echo 'access.format = "%{HTTP_X_FORWARDED_FOR}e - %u %t \"%m %r\" %s"' 1>> /usr/local/etc/php-fpm.d/docker.conf; \
else \
cat /etc/apache2/apache2.conf | sed 's/LogFormat "%h/LogFormat "%{X-Forwarded-for}i/' > /tmp/apache2.conf; \
cat /tmp/apache2.conf > /etc/apache2/apache2.conf ; rm -f /tmp/apache2.conf; \
fi; \
\
mkdir /var/www/data; \
chown -R www-data:root /var/www; \