Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix display of remote ip in php log #292

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 2024.08/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ RUN set -ex; \
RUN set -ex; \
a2enmod rewrite remoteip; \
{ \
echo RemoteIPHeader X-Real-IP; \
echo RemoteIPHeader X-Forwarded-For; \
echo RemoteIPTrustedProxy 127.0.0.0/8; \
echo RemoteIPTrustedProxy 10.0.0.0/8; \
echo RemoteIPTrustedProxy 172.16.0.0/12; \
echo RemoteIPTrustedProxy 192.168.0.0/16; \
Expand Down
3 changes: 2 additions & 1 deletion 2024.08/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ RUN set -ex; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www


RUN set -ex; \
echo access.format = '%{REMOTE_ADDR}e - %u %t "%m %r" %s' >> /usr/local/etc/php-fpm.d/docker.conf;

VOLUME /var/www/html

Expand Down
3 changes: 2 additions & 1 deletion 2024.08/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ RUN set -ex; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www


RUN set -ex; \
echo access.format = '%{REMOTE_ADDR}e - %u %t "%m %r" %s' >> /usr/local/etc/php-fpm.d/docker.conf;

VOLUME /var/www/html

Expand Down
3 changes: 2 additions & 1 deletion 2024.12/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ RUN set -ex; \
RUN set -ex; \
a2enmod rewrite remoteip; \
{ \
echo RemoteIPHeader X-Real-IP; \
echo RemoteIPHeader X-Forwarded-For; \
echo RemoteIPTrustedProxy 127.0.0.0/8; \
echo RemoteIPTrustedProxy 10.0.0.0/8; \
echo RemoteIPTrustedProxy 172.16.0.0/12; \
echo RemoteIPTrustedProxy 192.168.0.0/16; \
Expand Down
3 changes: 2 additions & 1 deletion 2024.12/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ RUN set -ex; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www


RUN set -ex; \
echo access.format = '%{REMOTE_ADDR}e - %u %t "%m %r" %s' >> /usr/local/etc/php-fpm.d/docker.conf;

VOLUME /var/www/html

Expand Down
3 changes: 2 additions & 1 deletion 2024.12/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ RUN set -ex; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www


RUN set -ex; \
echo access.format = '%{REMOTE_ADDR}e - %u %t "%m %r" %s' >> /usr/local/etc/php-fpm.d/docker.conf;

VOLUME /var/www/html

Expand Down
3 changes: 2 additions & 1 deletion 2025.02-dev/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ RUN set -ex; \
RUN set -ex; \
a2enmod rewrite remoteip; \
{ \
echo RemoteIPHeader X-Real-IP; \
echo RemoteIPHeader X-Forwarded-For; \
echo RemoteIPTrustedProxy 127.0.0.0/8; \
echo RemoteIPTrustedProxy 10.0.0.0/8; \
echo RemoteIPTrustedProxy 172.16.0.0/12; \
echo RemoteIPTrustedProxy 192.168.0.0/16; \
Expand Down
3 changes: 2 additions & 1 deletion 2025.02-dev/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ RUN set -ex; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www


RUN set -ex; \
echo access.format = '%{REMOTE_ADDR}e - %u %t "%m %r" %s' >> /usr/local/etc/php-fpm.d/docker.conf;

VOLUME /var/www/html

Expand Down
3 changes: 2 additions & 1 deletion 2025.02-dev/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ RUN set -ex; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www


RUN set -ex; \
echo access.format = '%{REMOTE_ADDR}e - %u %t "%m %r" %s' >> /usr/local/etc/php-fpm.d/docker.conf;

VOLUME /var/www/html

Expand Down
9 changes: 6 additions & 3 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ declare -A extras=(
[apache]='RUN set -ex; \
a2enmod rewrite remoteip; \
{ \
echo RemoteIPHeader X-Real-IP; \
echo RemoteIPHeader X-Forwarded-For; \
echo RemoteIPTrustedProxy 127.0.0.0/8; \
echo RemoteIPTrustedProxy 10.0.0.0/8; \
echo RemoteIPTrustedProxy 172.16.0.0/12; \
echo RemoteIPTrustedProxy 192.168.0.0/16; \
} > /etc/apache2/conf-available/remoteip.conf; \
a2enconf remoteip;'
[fpm]=''
[fpm-alpine]=''
[fpm]='RUN set -ex; \
echo access.format = '\''%{REMOTE_ADDR}e - %u %t \"%m %r\" %s'\'' >> /usr/local/etc/php-fpm.d/docker.conf;'
[fpm-alpine]='RUN set -ex; \
echo access.format = '\''%{REMOTE_ADDR}e - %u %t \"%m %r\" %s'\'' >> /usr/local/etc/php-fpm.d/docker.conf;'
)

declare -A entrypoints=(
Expand Down