Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Laravel
  3. Laravel Proxy

Laravel Proxy

MITPHP4.4.2

A Laravel package for configuring trusted proxies to ensure correct URL generation, redirects, and sessions behind load balancers.

GitHubGitHub
7.3k stars129 forks0 contributors

What is Laravel Proxy?

Laravel Trusted Proxy is a PHP package that configures Laravel applications to correctly interpret HTTP requests when behind reverse proxies like load balancers or CDNs. It solves the problem of applications misidentifying client details (e.g., using proxy IPs instead of real client IPs) by properly trusting and reading X-Forwarded headers. This ensures accurate URL generation, redirects, sessions, and logging in production setups.

Target Audience

Laravel developers deploying applications behind load balancers, reverse proxies, or caching services (e.g., AWS ELB/ALB, Nginx, CloudFlare) who need correct client information handling.

Value Proposition

Developers choose this package because it provides a simple, standardized way to configure trusted proxies in Laravel, eliminating common issues with URL generation and session handling in proxied environments. Its integration with Laravel's request handling and Symfony HTTP components offers reliability and security by allowing precise control over which proxies are trusted.

Overview

Laravel Proxy Package for handling sessions when behind load balancers or other intermediaries.

Use Cases

Best For

  • Laravel applications deployed behind AWS Elastic Load Balancer (ELB) or Application Load Balancer (ALB)
  • Ensuring correct HTTPS URL generation when load balancers terminate SSL and forward HTTP to backend servers
  • Maintaining accurate client IP addresses for logging and session management in proxied setups
  • Configuring trusted proxies for applications using CDNs like CloudFlare or caching layers like Varnish
  • Handling X-Forwarded headers securely to prevent spoofing in production environments
  • Simplifying proxy configuration for Laravel apps without manual Symfony HTTP kernel adjustments

Not Ideal For

  • Laravel 9.x and newer applications where built-in proxy handling is available and this package is deprecated
  • Projects not deployed behind any reverse proxy or load balancer, as it adds unnecessary configuration complexity
  • Applications requiring custom or non-standard proxy header handling beyond X-Forwarded headers, such as proprietary CDN setups

Pros & Cons

Pros

Easy Proxy Configuration

Simplifies setting trusted proxy IPs in Laravel, avoiding manual adjustments to Symfony HTTP classes as described in the README, making it accessible for common deployment scenarios.

Accurate Request Details

Ensures correct URL generation, redirects, and session handling by reading X-Forwarded headers from trusted proxies, critical for load-balanced setups like AWS ELB where SSL termination occurs.

Security-Focused Design

Allows trust configuration for specific proxies, reducing the risk of header spoofing compared to trusting all proxies indiscriminately, as highlighted in the security awareness feature.

Wide Compatibility

Supports common proxies like Nginx, HAProxy, AWS ELB/ALB, and CloudFlare, with a wiki listing IP addresses for popular services, making it versatile for production environments.

Cons

Deprecated for Newer Laravel

Not needed for Laravel 9.x and above, as built-in functionality exists; using it can lead to conflicts or redundancy, and the README explicitly advises against it for Laravel 9.x.

Security Compromises with Hosted Proxies

For services like AWS ELB with unknown IPs, you must trust all proxies, which the README notes increases vulnerability to spoofed headers, a significant trade-off in security.

Framework Lock-in

Specifically tailored for Laravel, so it's useless for applications built on other PHP frameworks or custom codebases, limiting its utility in mixed-technology stacks.

Frequently Asked Questions

Quick Stats

Stars7,315
Forks129
Contributors0
Open Issues1
Last commit2 years ago
CreatedSince 2013

Tags

#reverse-proxy#production-deployment#laravel#php-package#http-headers#session-management#load-balancer

Built With

P
PHP
L
Laravel

Included in

Laravel13.0k
Auto-fetched 1 day ago

Related Projects

LiveWireLiveWire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.

Stars23,502
Forks1,735
Last commit1 day ago
Debug BarDebug Bar

Debugbar for Laravel (Integrates PHP Debug Bar)

Stars19,179
Forks1,607
Last commit2 days ago
IDE HelperIDE Helper

IDE Helper for Laravel

Stars14,891
Forks1,188
Last commit23 days ago
Intervention ImageIntervention Image

PHP Image Processing

Stars14,330
Forks1,491
Last commit5 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub