PHPackages                             buonzz/reverseproxy - 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. [Caching](/categories/caching)
4. /
5. buonzz/reverseproxy

ActiveProject[Caching](/categories/caching)

buonzz/reverseproxy
===================

PHP Script to perform Reverse Proxy Functionality

1.0.0(12y ago)202193[1 issues](https://github.com/buonzz/reverseproxy/issues)MITPHPPHP &gt;=5.2.0

Since Apr 18Pushed 12y ago1 watchersCompare

[ Source](https://github.com/buonzz/reverseproxy)[ Packagist](https://packagist.org/packages/buonzz/reverseproxy)[ RSS](/packages/buonzz-reverseproxy/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

\##ReverseProxy PHP Script

A simple PHP script that can be used as a ReverseProxy. Although you can use Nginx, mod\_proxy or a dedicated software like Squid for this purpose, there are instances that you favor the ability to just do it in a PHP script that can be dropped in a single folder. There could be various reasons:

- You are in a shared hosting wherein tweaking server-wide stuffs is not possible
- For some reason, you have to serve the contents of a subdomain to be as sub-folder of another. For example you have site.yourdomain.com (server 1 ) and you want it to be accesible as [www.domain2.com/site](http://www.domain2.com/site) in another server
- You wanted to cache the contents
- The web server is inaccessible publicly
- You want to provide a simple proxyserver
- Visitor's country is restricted from visiting the actual site
- Anonymize your users

Requirements
============

[](#requirements)

- PHP &gt;= 5.2
- Apache mod\_rewrite enabled
- cURL extension enabled

Installation
============

[](#installation)

Use composer to install it

```
composer create-project buonzz/reverseproxy

```

edit config.php

```
define('MASKED_DOMAIN', 'http://www.google.com');
define('PROXY_SUBFOLDER', 'reverseproxy');
define('FOLLOW_LOCATION', FALSE);

```

- MASKED\_DOMAIN is the site where this script will be getting its contents from, should have no traliling slashes.
- PROXY\_SUBFOLDER this is in case you had placed your script in a subfolder, like for example Leave this to blank if you had placed this in the root of the domain
- FOLLOW\_LOCATION - indicates whether the script will follow the redirect returned by the source site

edit .htaccess

```
RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ /reverseproxy/index.php/$1 [L]

```

This directives allows the reverseproxy to catch all the URI intented for the original domain, like for example

```
http://www.originaldomain.com/blog/102014/hello-world

```

With this setting, you can use

```
http://www.yourdomain.com/reverseproxy/blog/102014/hello-world

```

and the uri will be passed to the index.php and can then be passed to the original domain to rerieve the contents. Remember that if you are serving the contents from the root domain you only need to use this

```
RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

Unknown

Total

1

Last Release

4411d ago

### Community

Maintainers

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

---

Top Contributors

[![buonzz](https://avatars.githubusercontent.com/u/946233?v=4)](https://github.com/buonzz "buonzz (5 commits)")[![paperdarwin](https://avatars.githubusercontent.com/u/5999388?v=4)](https://github.com/paperdarwin "paperdarwin (1 commits)")

---

Tags

proxycachebypassanonymousvpnreverseproxy

### Embed Badge

![Health badge](/badges/buonzz-reverseproxy/health.svg)

```
[![Health](https://phpackages.com/badges/buonzz-reverseproxy/health.svg)](https://phpackages.com/packages/buonzz-reverseproxy)
```

###  Alternatives

[psr/simple-cache

Common interfaces for simple caching

8.1k727.3M2.1k](/packages/psr-simple-cache)[psr/cache

Common interface for caching libraries

5.2k686.9M1.3k](/packages/psr-cache)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[beste/in-memory-cache

A PSR-6 In-Memory cache that can be used as a fallback implementation and/or in tests.

2512.2M6](/packages/beste-in-memory-cache)[anahkiasen/flatten

A package for the Illuminate framework that flattens pages to plain HTML

33313.0k](/packages/anahkiasen-flatten)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23817.0k1](/packages/rtcamp-nginx-helper)

PHPackages © 2026

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