Skip to content

A free open source IT asset/license management system

3.0 KB
Raw Blame
<?php

/*
 |--------------------------------------------------------------------------
 | DO NOT EDIT THIS FILE DIRECTLY.
 |--------------------------------------------------------------------------
 | This file reads from your .env configuration file and should not
 | be modified directly.
*/

return [

    /*
     * Set trusted proxy IP addresses.
     *
     * Both IPv4 and IPv6 addresses are
     * supported, along with CIDR notation.
     *
     * The "*" character is syntactic sugar
     * within TrustedProxy to trust any proxy
     * that connects directly to your server,
     * a requirement when you cannot know the address
     * of your proxy (e.g. if using ELB or similar).
     *
     * The "**" character is syntactic sugar within
     * TrustedProxy to trust not just any proxy that
     * connects directly to your server, but also
     * proxies that connect to those proxies, and all
     * the way back until you reach the original source
     * IP. It will mean that $request->getClientIp()
     * always gets the originating client IP, no matter
     * how many proxies that client's request has
     * subsequently passed through.
     *
     * If you're looking for a sensible default for this value,
     * in many cases that would be 'PRIVATE_SUBNETS' or 'private_ranges'
     * (They both do the same thing; they 'trust' any private non-routable
     * IP, which is usually how most load-balancers and proxies are configured).
     *
     * This is a comma-separated list of IP addresses, **or** '*', or '**', or
     * 'PRIVATE_SUBNETS' or 'private_ranges'
     */
    'proxies' => env('APP_TRUSTED_PROXIES') ?
        explode(',', env('APP_TRUSTED_PROXIES')) : '',

    /*
     * If APP_TRUSTED_HEADERS is left unset, NO forwarded headers are
     * trusted, regardless of 'proxies' above. There is no fallback to a
     * default header set - trusting X-Forwarded-* is strictly opt-in, one
     * header at a time, via the setting below.
     *
     * This is a comma-delimited list.
     */

    'headers' => env('APP_TRUSTED_HEADERS', ''),

    /*
     * These are the valid headers you can choose to trust.
     *
     * The list of headers should be comma-separated; use as many as you need, but only use those that you actually
     * _need_ - don't just pick everything at random.
     *
     * Generally you should *not* be using a combination of HEADER_X_FORWARDED_AWS_ELB and anything else,
     * nor HEADER_X_FORWARDED_TRAEFIK and anything else. If you're using HEADER_FORWARDED, you generally won't
     * need anything else either. the various X_FORWARDED_FOR, X_FORWARDED_HOST, etc are often used together.
     *
       HEADER_FORWARDED // When using RFC 7239
       HEADER_X_FORWARDED_FOR
       HEADER_X_FORWARDED_HOST
       HEADER_X_FORWARDED_PROTO
       HEADER_X_FORWARDED_PORT
       HEADER_X_FORWARDED_PREFIX

       HEADER_X_FORWARDED_AWS_ELB // AWS ELB doesn't send X-Forwarded-Host
       HEADER_X_FORWARDED_TRAEFIK // All "X-Forwarded-*" headers sent by Traefik reverse proxy
     */

];