跳到正文

Laravel Cloudflare

活跃
monicahq/laravel-cloudflare

把 Cloudflare 的 IP 段加入 Laravel 的受信任代理,让应用在 Cloudflare 之后也能正确获取访客 IP 并识别 HTTPS。

在 GitHub 查看
星标
351
Fork
33
关注
351
未关闭 Issue
7

该介绍目前仅提供英文版本。

Overview

laravel-cloudflare adds Cloudflare’s IP addresses to Laravel’s trusted proxies, so $request->ip() returns the real visitor IP and HTTPS is detected correctly when your app sits behind Cloudflare.

Installation

composer require monicahq/laravel-cloudflare

Then replace Laravel’s TrustProxies middleware with the package’s middleware in bootstrap/app.php.

Customizing

Call LaravelCloudflare::getProxiesUsing() — typically in your AppServiceProvider — to change how the proxy list is resolved.

按共同分类和标签排序的同类开源项目。

全部 Web 框架项目 →