28
|
1 |
## vhost with proxyPass directive |
|
2 |
# NB: Please see the other vhost_*.pp example files for further |
|
3 |
# examples. |
|
4 |
|
|
5 |
# Base class. Declares default vhost on port 80 and default ssl |
|
6 |
# vhost on port 443 listening on all interfaces and serving |
|
7 |
# $apache::docroot |
|
8 |
class { 'apache': } |
|
9 |
|
|
10 |
# Most basic vhost with proxy_pass |
|
11 |
apache::vhost { 'first.example.com': |
|
12 |
port => 80, |
|
13 |
docroot => '/var/www/first', |
|
14 |
proxy_pass => [ |
|
15 |
{ |
|
16 |
'path' => '/first', |
|
17 |
'url' => 'http://localhost:8080/first' |
|
18 |
}, |
|
19 |
], |
|
20 |
} |
|
21 |
|
|
22 |
# vhost with proxy_pass and parameters |
|
23 |
apache::vhost { 'second.example.com': |
|
24 |
port => 80, |
|
25 |
docroot => '/var/www/second', |
|
26 |
proxy_pass => [ |
|
27 |
{ |
|
28 |
'path' => '/second', |
|
29 |
'url' => 'http://localhost:8080/second', |
|
30 |
'params' => { |
|
31 |
'retry' => '0', |
|
32 |
'timeout' => '5' |
|
33 |
} |
|
34 |
}, |
|
35 |
], |
|
36 |
} |
|
37 |
|
|
38 |
# vhost with proxy_pass and keywords |
|
39 |
apache::vhost { 'third.example.com': |
|
40 |
port => 80, |
|
41 |
docroot => '/var/www/third', |
|
42 |
proxy_pass => [ |
|
43 |
{ |
|
44 |
'path' => '/third', |
|
45 |
'url' => 'http://localhost:8080/third', |
|
46 |
'keywords' => ['noquery', 'interpolate'] |
|
47 |
}, |
|
48 |
], |
|
49 |
} |
|
50 |
|
|
51 |
# vhost with proxy_pass, parameters and keywords |
|
52 |
apache::vhost { 'fourth.example.com': |
|
53 |
port => 80, |
|
54 |
docroot => '/var/www/fourth', |
|
55 |
proxy_pass => [ |
|
56 |
{ |
|
57 |
'path' => '/fourth', |
|
58 |
'url' => 'http://localhost:8080/fourth', |
|
59 |
'params' => { |
|
60 |
'retry' => '0', |
|
61 |
'timeout' => '5' |
|
62 |
}, |
|
63 |
'keywords' => ['noquery', 'interpolate'] |
|
64 |
}, |
|
65 |
], |
|
66 |
} |