Fix: configure Apache to trust X-Forwarded-Proto from Traefik

This commit is contained in:
2026-03-15 14:33:07 +00:00
parent 12f7304b12
commit 718b9ba591
+12
View File
@@ -5,6 +5,18 @@
FROM espocrm/espocrm:latest
# Fix redirect loop behind Traefik reverse proxy
RUN a2enmod remoteip headers && \
echo '<IfModule mod_remoteip.c>\n\
RemoteIPHeader X-Forwarded-For\n\
</IfModule>\n\
<IfModule mod_headers.c>\n\
RequestHeader set X-Forwarded-Proto "https" env=HTTPS\n\
</IfModule>\n\
SetEnvIf X-Forwarded-Proto "https" HTTPS=on' \
> /etc/apache2/conf-available/reverse-proxy.conf && \
a2enconf reverse-proxy
# Copy custom extensions and modifications
COPY custom/ /var/www/html/custom/