trustedproxy.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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' => ['172.31.0.0/16'], // [<ip addresses>,], '*'
  17. /*
  18. * To trust one or more specific proxies that connect
  19. * directly to your server, use an array of IP addresses:
  20. */
  21. # 'proxies' => ['192.168.1.1'],
  22. /*
  23. * Or, to trust all proxies that connect
  24. * directly to your server, use a "*"
  25. */
  26. # 'proxies' => '*',
  27. /*
  28. * Which headers to use to detect proxy related data (For, Host, Proto, Port)
  29. *
  30. * Options include:
  31. *
  32. * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
  33. * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
  34. *
  35. * @link https://symfony.com/doc/current/deployment/proxies.html
  36. */
  37. 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
  38. ];