Skip to content

Commit c7d0bc3

Browse files
authored
Merge pull request #230 from MaRDI4NFDI/activate_apache_remoteip
Configure remoteip
2 parents 129935b + 1ce63bd commit c7d0bc3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ RUN apt-get update && \
6666

6767
RUN a2enmod rewrite
6868

69+
# Enable mod_remoteip to log real client IPs from X-Forwarded-For header
70+
RUN a2enmod remoteip
71+
COPY apache/remoteip.conf /etc/apache2/conf-available/remoteip.conf
72+
RUN a2enconf remoteip
73+
RUN sed -i 's/%h/%a/g' /etc/apache2/apache2.conf
74+
6975
RUN install -d /var/log/mediawiki -o www-data
7076
RUN pecl install redis && docker-php-ext-enable redis
7177
RUN pecl install yaml && docker-php-ext-enable yaml

apache/remoteip.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<IfModule remoteip_module>
2+
RemoteIPHeader X-Forwarded-For
3+
RemoteIPTrustedProxy 10.0.0.0/8
4+
</IfModule>

0 commit comments

Comments
 (0)