Added reverse proxy support

This commit is contained in:
Jeroen De Meerleer 2021-05-26 15:25:02 +02:00
parent 7a1ed50247
commit 5ced8b46f0
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 6 additions and 1 deletions

View File

@ -25,4 +25,8 @@ HASHING_METHOD="sha256"
## This secret value is used to encrypt secret values (eg. ssh-keys, http-auth passwords, etc)
## You should consider your already stored secret values lost when changing this value.
COOKIE_LIFETIME=2592000
COOKIE_LIFETIME=2592000
## TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy.
## Set it to the IP address of your proxy. YOu can set to multiple proxies by comma-separating them
TRUSTED_PROXIES=127.0.0.1

View File

@ -94,6 +94,7 @@ class Kernel
private function parseRequest(): Request
{
Request::setTrustedProxies(explode(',', $_ENV['TRUSTED_PROXIES']), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);
$request = Request::createFromGlobals();
return $request;
}