Skip to content

Commit 36afa5b

Browse files
committed
changed example destination host var and base_url. minor comments update
1 parent 497461a commit 36afa5b

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is a simple php proxy script. It can be used where it is difficult to use o
88
nginx or lighttpd. You can currently specify one single domain that this script proxies to.
99
You can also specify a number of headers that are proxied.
1010

11-
### Installation Usage
11+
### Installation & Usage
1212

1313
Download and put the files into an accessible path on your website. Then copy src/example.simple-php-proxy_config.php
1414
to src/simple-php-proxy_config.php or to one or two levels above. Finally change the config values accordingly.

src/example.simple-php-proxy_config.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@
1212
would now be proxied to
1313
"http://bob.com/my_other_uri/that/resides/on/bob"
1414
and the output returned
15+
16+
replace this to where you want to proxy
1517
*/
16-
$dest_host = "example.com";
18+
$dest_host = "bash.org";
1719

1820
/*
1921
Location of your proxy index script relative to your web root
2022
The first slash is needed the trailing slash is optional
2123
22-
Use '/' if you place index.php on the root level.
24+
Use '/my_project/simple-php-proxy/src' if you place the whole folder within your project
25+
or for usage at webroot level use '/'
2326
*/
24-
$proxy_base_url = '/simple-php-proxy/src';
27+
$proxy_base_url = '/';
2528

2629
/*
2730
What headers to proxy from destination host to client

src/index.php

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,24 @@
22

33
define('CONFIG_FILE', 'simple-php-proxy_config.php');
44

5-
/*
6-
Change the config settings here or copy example.simple-php-proxy_config.php
7-
to simple-php-proxy_config.php in same folder as this script or to one or two levels above it.
8-
The usage of the config file is optional.
9-
*/
10-
115
/*
12-
Allowed destination host, request URIs are fetched from there
6+
Installation note:
137
14-
Say your proxy script resides on "http://www.alice.com/folder/simple-php-proxy/src/index.php"
15-
You set
16-
$dest_host = "bob.com";
17-
$proxy_base_url = '/folder/simple-php-proxy/src';
18-
19-
A request to "http://www.alice.com/folder/simple-php-proxy/src/index.php/my_other_uri/that/resides/on/bob"
20-
would now be proxied to
21-
"http://bob.com/my_other_uri/that/resides/on/bob"
22-
and the output returned
23-
*/
24-
$dest_host = "example.com";
8+
Copy example.simple-php-proxy_config.php to simple-php-proxy_config.php
9+
in the same folder as this script or to one or two levels above it.
2510
26-
/*
27-
Location of your proxy index script relative to your web root
28-
The first slash is needed the trailing slash is optional
11+
Optionally you can change the variables right here and not use the config file.
2912
30-
Use '/' if you place index.php on the root level.
13+
For an explanation of the config variables see example.simple-php-proxy_config.php
3114
*/
32-
$proxy_base_url = '/simple-php-proxy/src';
3315

34-
/*
35-
What headers to proxy from destination host to client
36-
*/
37-
$proxied_headers = array('Set-Cookie', 'Content-Type', 'Cookie', 'Location');
16+
//$dest_host = "bash.org";
17+
18+
//$proxy_base_url = '/';
3819

39-
/* END OF CONFIGURATION */
20+
//$proxied_headers = array('Set-Cookie', 'Content-Type', 'Cookie', 'Location');
4021

22+
// Variables you specify in the config file overwrite variables set above.
4123
foreach( array('./', '../', '../../') as $path_rel )
4224
{
4325
if( file_exists(dirname(__file__)."/$path_rel" . CONFIG_FILE) )

0 commit comments

Comments
 (0)