From 7019c1303fd06fafb5517efda250f18ce6ee0836 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 17 Nov 2022 18:30:24 +0100 Subject: [PATCH] Adding config/trustedproxy.php --- .env.example | 2 ++ config/trustedproxy.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 config/trustedproxy.php diff --git a/.env.example b/.env.example index f89ff69..cedee66 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,5 @@ DB_CONNECTION=sqlite CACHE_DRIVER=file QUEUE_CONNECTION=sync + +TRUSTED_PROXIES=127.0.0.1,1.1.1.1 \ No newline at end of file diff --git a/config/trustedproxy.php b/config/trustedproxy.php new file mode 100644 index 0000000..99a1848 --- /dev/null +++ b/config/trustedproxy.php @@ -0,0 +1,33 @@ + explode(',', env('TRUSTED_PROXIES')), + + /* + * Which headers to use to detect proxy related data (For, Host, Proto, Port) + * + * Options include: + * + * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust) + * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust) + * + * @link https://symfony.com/doc/current/deployment/proxies.html + */ + 'headers' => Request::HEADER_X_FORWARDED_ALL, +]; \ No newline at end of file