mirror of
https://github.com/friendica/docker
synced 2025-12-07 22:07:09 +01:00
Merge pull request #292 from ne20002/feat/forwarded-for-header
Fix display of remote ip in php log
This commit is contained in:
commit
ae32b8342f
10 changed files with 24 additions and 12 deletions
|
|
@ -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; \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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; \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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; \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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=(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue