PHPackages                             csun-metalab/lumen-proxypass - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. csun-metalab/lumen-proxypass

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

csun-metalab/lumen-proxypass
============================

Composer package for Lumen that resolves the correct absolute URLs when behind a proxy

1.1.0(8y ago)06.6kMITPHPPHP &gt;=5.5.9

Since Apr 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/PioneeringTechLab/lumen-proxypass)[ Packagist](https://packagist.org/packages/csun-metalab/lumen-proxypass)[ RSS](/packages/csun-metalab-lumen-proxypass/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (7)Used By (0)

Lumen Proxy Pass
================

[](#lumen-proxy-pass)

Composer package for Lumen that resolves the correct absolute URLs when behind a proxy

This package is built for version 5.0 of Lumen and above. It modifies the functionality of the `url()`, `asset()`, and other helper methods.

To install from Composer, use the following command:

```
composer require csun-metalab/lumen-proxypass

```

Installation
------------

[](#installation)

First, add the following lines to your .env file to leverage the proxy attributes:

```
PROXY_ACTIVE=true
PROXY_PATH_HEADER=HTTP_X_FORWARDED_PATH

```

You may also add the following optional lines to your .env file to leverage the ability to FORCE the URL and schema without having to pass through a load balancer or proxy:

```
# http or https: PUBLIC_SCHEMA_OVERRIDE=https
PUBLIC_SCHEMA_OVERRIDE=

# Example: PUBLIC_URL_OVERRIDE=http://some-other-domain.example.com/some-other-directory
PUBLIC_URL_OVERRIDE=

```

Next, register the service provider and the configuration file in `bootstrap/app.php` as follows:

```
$app->configure('proxypass');
$app->register(CSUNMetaLab\LumenProxyPass\Providers\ProxyPassServiceProvider::class);

```

### Configuration File

[](#configuration-file)

If you do not already have a `config` directory in your project root, go ahead and create it.

In order to leverage the custom configuration values from this package, copy and paste the following code into a file called `proxypass.php` within your `config` directory in Lumen:

```

```

Environment Variables
---------------------

[](#environment-variables)

The two environment variables you added to your .env file are the following:

### PROXY\_ACTIVE

[](#proxy_active)

Set this to `true` to enable the proxying functionality or `false` to disable it.

### PROXY\_PATH\_HEADER

[](#proxy_path_header)

This is the PHP-interpreted value of the request header sent from your proxy. The default is `HTTP_X_FORWARDED_PATH` (the computed value of `X-Forwarded-Path`)

Trusted Proxies
---------------

[](#trusted-proxies)

This package also has the ability to allow only certain proxy servers to modify the necessary values in order to set the proper absolute URL.

By default, all proxy servers are allowed to modify the values; if, however, the following value is set in your .env file then you can create a whitelist of proxies:

### TRUSTED\_PROXIES

[](#trusted_proxies)

This is a comma-delimited list of hostnames/IP addresses that are allowed to perform proxying functions.

```
TRUSTED_PROXIES=192.168.1.10,www.example.com,192.168.3.12

```

The above example would allow the following three proxy servers to provide proxying functionality:

- 192.168.1.10 (would come from the `REMOTE_ADDR` value in PHP)
- [www.example.com](http://www.example.com) (would come from the `X-Forwarded-Server` header from the web server)
- 192.168.3.12 (would come from the `REMOTE_ADDR` value in PHP)

Usage Example
-------------

[](#usage-example)

Let's say you have an API hosted at `http://lumen.example.com` but that is not the location you want to show to the world. Instead, you want to show a URL of `http://www.example.com/lumen` so you place your Lumen API behind a proxy.

However, you notice that while the front page loads properly, none of the URLs you have written with the `url()`, `asset()`, or other helpers work with that URL and instead continue writing `http://lumen.example.com` as their base path.

You can configure your proxy to add a request header along with your `ProxyPass` and `ProxyPassReverse` directives in Apache (ensure you have `mod_headers` enabled and `mod_proxy` enabled as well):

```
ProxyPass        /lumen http://lumen.example.com
ProxyPassReverse /lumen http://lumen.example.com

RequestHeader set X-Forwarded-Path "http://www.example.com/lumen"

```

Now all of your URLs using the `url()`, `asset()`, and other helpers will be written correctly!

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Recently: every ~52 days

Total

6

Last Release

3157d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef2f088dbe515e7505204053ba4b89fab631db23d7638297853dc697adf7ddc4?d=identicon)[matthewfritz](/maintainers/matthewfritz)

![](https://www.gravatar.com/avatar/5c86fd91fdf698dd5c9ceffd3dce175a6ae3000d00f4c00bf65b2e97f19072a1?d=identicon)[csun-metalab](/maintainers/csun-metalab)

![](https://www.gravatar.com/avatar/eb2e4b7e97c47122102e9eca3a2707f31d812f27d774197f62f27f130d128e49?d=identicon)[luisjg](/maintainers/luisjg)

---

Top Contributors

[![matthewfritz](https://avatars.githubusercontent.com/u/1715181?v=4)](https://github.com/matthewfritz "matthewfritz (7 commits)")

### Embed Badge

![Health badge](/badges/csun-metalab-lumen-proxypass/health.svg)

```
[![Health](https://phpackages.com/badges/csun-metalab-lumen-proxypass/health.svg)](https://phpackages.com/packages/csun-metalab-lumen-proxypass)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
