Docker: Use Apache remoteip (#3226)

#fix https://github.com/FreshRSS/FreshRSS/issues/3224
Log the client remote IP instead of the local proxy IP
https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html
pull/3231/head
Alexandre Alapetite 4 years ago committed by GitHub
parent c6b843e04e
commit 9ab05c7f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Docker/Dockerfile
  2. 2
      Docker/Dockerfile-Alpine
  3. 2
      Docker/Dockerfile-QEMU-ARM
  4. 5
      Docker/FreshRSS.Apache.conf

@ -35,7 +35,7 @@ LABEL \
org.opencontainers.image.version="$FRESHRSS_VERSION"
RUN a2dismod -f alias autoindex negotiation status && \
a2enmod deflate expires headers mime setenvif && \
a2enmod deflate expires headers mime remoteip setenvif && \
a2disconf '*' && \
a2dissite '*' && \
a2ensite 'FreshRSS*'

@ -34,7 +34,7 @@ RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \
/etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \
sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \
/etc/apache2/httpd.conf && \
sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|headers|mime|setenvif).so$/s/^\s*#//" \
sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|headers|mime|remoteip|setenvif).so$/s/^\s*#//" \
/etc/apache2/httpd.conf && \
sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \
/etc/apache2/httpd.conf && \

@ -41,7 +41,7 @@ LABEL \
org.opencontainers.image.version="$FRESHRSS_VERSION"
RUN a2dismod -f alias autoindex negotiation status && \
a2enmod deflate expires headers mime setenvif && \
a2enmod deflate expires headers mime remoteip setenvif && \
a2disconf '*' && \
a2dissite '*' && \
a2ensite 'FreshRSS*'

@ -1,7 +1,10 @@
ServerName freshrss.localhost
Listen 0.0.0.0:80
DocumentRoot /var/www/FreshRSS/p/
CustomLog /dev/stdout combined
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 10.0.0.1/8 172.16.0.1/12 192.168.0.1/16
LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_proxy
CustomLog /dev/stdout combined_proxy
ErrorLog /dev/stderr
AllowEncodedSlashes On
ServerTokens OS

Loading…
Cancel
Save