Compare commits

...

3 Commits

Author SHA1 Message Date
Kevin Papst
8a5bc3bfc1 merge base 2024-10-04 11:17:24 +02:00
Kevin Papst
0c2236d7f6 Merge branch 'refs/heads/main' into docker-ips
# Conflicts:
#	.docker/Dockerfile.kimai-base
2024-10-04 11:16:17 +02:00
Kevin Papst
a629e3d83e pass proxy values for Apache webserver 2024-09-22 16:22:03 +02:00
2 changed files with 16 additions and 0 deletions

View File

@@ -10,6 +10,19 @@
PassEnv TRUSTED_PROXIES PassEnv TRUSTED_PROXIES
PassEnv TRUSTED_HOSTS PassEnv TRUSTED_HOSTS
SetEnvIf X-Forwarded-Proto https HTTPS=on
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
RemoteIPHeader X-Forwarded-For
# Define a macro to set the RemoteIPTrustedProxy directive
<Macro SetTrustedProxy PROXY>
RemoteIPTrustedProxy ${PROXY}
</Macro>
# Use the macro, passing the environment variable TRUSTED_PROXIES
Use SetTrustedProxy %{TRUSTED_PROXIES}e
<Directory "/opt/kimai/public"> <Directory "/opt/kimai/public">
Require all granted Require all granted
DirectoryIndex index.php DirectoryIndex index.php

View File

@@ -168,6 +168,9 @@ RUN apt-get update && \
libfreetype6 && \ libfreetype6 && \
echo "Listen 8001" > /etc/apache2/ports.conf && \ echo "Listen 8001" > /etc/apache2/ports.conf && \
a2enmod rewrite && \ a2enmod rewrite && \
a2enmod headers && \
a2enmod remoteip && \
a2enmod macro && \
touch /use_apache touch /use_apache
COPY .docker/000-default.conf /etc/apache2/sites-available/000-default.conf COPY .docker/000-default.conf /etc/apache2/sites-available/000-default.conf