Skip to content

Commit

Permalink
Merge pull request #90 from stsnel/add-config-parameter-for-proxy
Browse files Browse the repository at this point in the history
Add config parameter for running behind a proxy
  • Loading branch information
lsamshuijzen authored Jan 13, 2025
2 parents e239aac + 3116ada commit 03c9835
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ CKAN_ROOT_URL=

FAST_API_TOKEN=

VOCABULARIES_CURRENT_VERSION=
VOCABULARIES_CURRENT_VERSION=

RUN_BEHIND_PROXY=false
5 changes: 5 additions & 0 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
5 changes: 5 additions & 0 deletions config/proxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'run_behind_proxy'=> env('RUN_BEHIND_PROXY', false)
];

0 comments on commit 03c9835

Please sign in to comment.