定制 mamyraoby/laravel-proxy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mamyraoby/laravel-proxy

Composer 安装命令:

composer require mamyraoby/laravel-proxy

包简介

Better support reverse proxy Laravel deployement

README 文档

README

What are the use of this package?

  • Automated Configuration: The package automates the configuration process for Laravel apps deployed behind reverse proxy web servers. This is beneficial because it eliminates the need for repetitive manual configuration each time the app is deployed, saving time and reducing the potential for human error.

  • Asset Handling: One of the key issues it addresses is the incorrect serving of built and dynamic assets. Reverse proxies can sometimes cause issues with how assets are delivered to the client, and this package ensures that assets are served correctly without additional manual adjustments.

  • Quick Setup: By using this package, developers can quickly set up their Laravel application for deployment behind a reverse proxy, making the deployment process more efficient.

Installation

Add mamyraoby/laravel-proxy as depenceny of your project, by running the following command:

composer require mamyraoby/laravel-proxy

Then register this middleware into your application:

Laravel 11 and above

Open the bootstrap/app.php and add the following line inside the middlewares registration section:

$middleware->append([
    \MamyRaoby\LaravelProxy\Middleware\ProxyMiddleware::class,
]);

Laravel ancient version

Open the app/Http/Kernel.php and update the middleware attrubutes value by adding this line:

protected $middleware = [
    \MamyRaoby\LaravelProxy\Middleware\ProxyMiddleware::class,
];

You may set up these env variables into your .env file:

  • PROXY_SCHEME:

    Accepted value: http or https . Default to http if not set.

  • PROXY_URL:

    Accepted value: The base URL of the reverse proxy server. Example: https://example.com, make sure to include the port if you run from port different form 80 or 443. Default to APP_URL env value if not set.

  • PROXY_TRUSTED_IPS:

    A set of trusted proxies IP address, separated by comma.

    Example: PROXY_TRUSTED_IPS=172.1.0.0,192.168.1.1

    Default to * if not set, which means always trust everything.

    Unset this variable if your server has dynamic IP address or in case you don't know exactly the IP addresses for your server.

You should be good now, but if you need any further configuration or extension, you may publish the configuration file from the vendor, by running the following command:

php artisan vendor:publish mamyraoby-laravel-proxy-config

... and feel free to update your configuration.

Contribution

If you want to contribute or signal bugs, don't hesitate to open an issue or make a pull request, I also open to discuss, so email me at mamyraoby@outlook.com.

mamyraoby/laravel-proxy 适用场景与选型建议

mamyraoby/laravel-proxy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 55 次下载、GitHub Stars 达 3, 最近一次更新时间为 2024 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mamyraoby/laravel-proxy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mamyraoby/laravel-proxy 我们能提供哪些服务?
定制开发 / 二次开发

基于 mamyraoby/laravel-proxy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 55
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-06-14