diff --git a/.env.example b/.env.example index d9978db..ac15d45 100644 --- a/.env.example +++ b/.env.example @@ -57,4 +57,6 @@ CKAN_ROOT_URL= FAST_API_TOKEN= -VOCABULARIES_CURRENT_VERSION= \ No newline at end of file +VOCABULARIES_CURRENT_VERSION= + +RUN_BEHIND_PROXY=false diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 0c7d3b6..e2ada9b 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -25,4 +25,9 @@ class TrustProxies extends Middleware Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB; + + public function __construct() + { + $this->proxies = config('proxy.run_behind_proxy') ? '*' : null; + } } diff --git a/config/proxy.php b/config/proxy.php new file mode 100644 index 0000000..814934a --- /dev/null +++ b/config/proxy.php @@ -0,0 +1,5 @@ + env('RUN_BEHIND_PROXY', false) +];