Skip to content

Commit d481e10

Browse files
committed
Added option to trust reverse proxy X-Forwarded-Proto header (fixes #19)
1 parent c6fa57f commit d481e10

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ HTTPS :
182182
- **PHPLDAPADMIN_HTTPS_KEY_FILENAME**: Apache ssl certificate private key filename. Defaults to `phpldapadmin.key`
183183
- **PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME**: Apache ssl CA certificate filename. Defaults to `ca.crt`
184184

185+
Reverse proxy HTTPS :
186+
- **PHPLDAPADMIN_TRUST_PROXY_SSL**: Set to `true` to trust X-Forwarded-Proto header
187+
185188
Ldap client TLS/LDAPS :
186189

187190
- **PHPLDAPADMIN_LDAP_CLIENT_TLS**: Enable ldap client tls config, ldap serveur certificate check and set client certificate. Defaults to `true`

image/service/phpldapadmin/startup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ else
3131
ln -sf ${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/http.conf /etc/apache2/sites-available/phpldapadmin.conf
3232
fi
3333

34+
#
35+
# Reverse proxy config
36+
#
37+
if [ "${PHPLDAPADMIN_TRUST_PROXY_SSL,,}" == "true" ]; then
38+
echo 'SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on' > /etc/apache2/mods-enabled/remoteip_ssl.conf
39+
fi
40+
3441
a2ensite phpldapadmin | log-helper debug
3542

3643
#

0 commit comments

Comments
 (0)