trustedproxy.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. return [
  3. /*
  4. * Set trusted proxy IP addresses.
  5. *
  6. * Both IPv4 and IPv6 addresses are
  7. * supported, along with CIDR notation.
  8. *
  9. * The "*" character is syntactic sugar
  10. * within TrustedProxy to trust any proxy
  11. * that connects directly to your server,
  12. * a requirement when you cannot know the address
  13. * of your proxy (e.g. if using ELB or similar).
  14. *
  15. */
  16. 'proxies' => null, // [<ip addresses>,], '*', '<ip addresses>,'
  17. /*
  18. * To trust one or more specific proxies that connect
  19. * directly to your server, use an array or a string separated by comma of IP addresses:
  20. */
  21. // 'proxies' => ['192.168.1.1'],
  22. // 'proxies' => '192.168.1.1, 192.168.1.2',
  23. /*
  24. * Or, to trust all proxies that connect
  25. * directly to your server, use a "*"
  26. */
  27. // 'proxies' => '*',
  28. /*
  29. * Which headers to use to detect proxy related data (For, Host, Proto, Port)
  30. *
  31. * Options include:
  32. *
  33. * - All headers (see below) - Trust all x-forwarded-* headers
  34. * - Illuminate\Http\Request::HEADER_FORWARDED - Use the FORWARDED header to establish trust
  35. * - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB - If you are using AWS Elastic Load Balancer
  36. *
  37. * @link https://symfony.com/doc/current/deployment/proxies.html
  38. */
  39. 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_FOR | Illuminate\Http\Request::HEADER_X_FORWARDED_HOST | Illuminate\Http\Request::HEADER_X_FORWARDED_PORT | Illuminate\Http\Request::HEADER_X_FORWARDED_PROTO | Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB,
  40. ];