|
2 | 2 |
|
3 | 3 | define('CONFIG_FILE', 'simple-php-proxy_config.php'); |
4 | 4 |
|
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 | | - |
11 | 5 | /* |
12 | | -Allowed destination host, request URIs are fetched from there |
| 6 | + Installation note: |
13 | 7 |
|
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. |
25 | 10 |
|
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. |
29 | 12 |
|
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 |
31 | 14 | */ |
32 | | -$proxy_base_url = '/simple-php-proxy/src'; |
33 | 15 |
|
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 = '/'; |
38 | 19 |
|
39 | | -/* END OF CONFIGURATION */ |
| 20 | +//$proxied_headers = array('Set-Cookie', 'Content-Type', 'Cookie', 'Location'); |
40 | 21 |
|
| 22 | +// Variables you specify in the config file overwrite variables set above. |
41 | 23 | foreach( array('./', '../', '../../') as $path_rel ) |
42 | 24 | { |
43 | 25 | if( file_exists(dirname(__file__)."/$path_rel" . CONFIG_FILE) ) |
|
0 commit comments