Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gentics/proxy-php
A simple HTTP proxy to work around CORS limitations
https://github.com/gentics/proxy-php
Last synced: about 2 months ago
JSON representation
A simple HTTP proxy to work around CORS limitations
- Host: GitHub
- URL: https://github.com/gentics/proxy-php
- Owner: gentics
- Created: 2012-08-06T10:00:01.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-19T10:04:21.000Z (almost 10 years ago)
- Last Synced: 2024-05-01T22:48:01.725Z (8 months ago)
- Language: PHP
- Size: 155 KB
- Stars: 21
- Watchers: 35
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# proxy-php
A simple PHP proxy that makes it possible to work around CORS limitations between a frontend and a backend server.
## Overview
The request cycle is as follows
* the browser makes a request to "/$PROXYNAME/xx" on the frontend server
* the proxy script takes everything after "/$PROXYNAME/" and appends it to $CMS_SERVERHOST
* the proxy script makes a request to the resulting URL $CMS_SERVERHOST/xx on the backend server
* the response is directed back to the browser## Requirements
* PHP
* Apache mod_rewrite module
* Apache mod_setenvif module## Usage
Copy this folder to the document root of your frontend server and preferrably call the folder 'proxy'.
Adapt the settings.conf.php file and customize the following variables
```php
// The URL of the backend server that browser requests should be proxied to
$CMS_SERVERHOST = 'http://example.com/';// The path to the proxy script on the frontend server
$PROXYNAME = '/proxy/';
```