|
2 | 2 | # redirect those sites to the appropriate pages on ocfweb. |
3 | 3 | class ocf_www::site::ocfweb_redirects { |
4 | 4 | # accounts |
5 | | - $accounts_canonical_url = $::host_env ? { |
6 | | - 'dev' => 'https://dev-accounts.ocf.berkeley.edu/', |
7 | | - 'prod' => 'https://accounts.ocf.berkeley.edu/', |
8 | | - } |
9 | | - |
10 | 5 | $accounts_options = { |
11 | 6 | servername => 'accounts.ocf.berkeley.edu', |
12 | 7 | serveraliases => ['dev-accounts.ocf.berkeley.edu'], |
|
21 | 16 | ], |
22 | 17 | } |
23 | 18 |
|
24 | | - apache::vhost { 'accounts': |
25 | | - * => $accounts_options, |
26 | | - port => 443, |
27 | | - ssl => true, |
28 | | - headers => ['always set Strict-Transport-Security max-age=31536000'], |
29 | | - ssl_key => "/etc/ssl/private/${::fqdn}.key", |
30 | | - ssl_cert => "/etc/ssl/private/${::fqdn}.crt", |
31 | | - ssl_chain => "/etc/ssl/private/${::fqdn}.intermediate", |
32 | | - } |
33 | | - |
34 | | - # nginx backend (plain HTTP on localhost) |
35 | 19 | apache::vhost { 'accounts-backend': |
36 | | - * => $accounts_options, |
37 | | - port => $ocf_www::backend_port, |
38 | | - } |
39 | | - |
40 | | - apache::vhost { 'accounts-http-redirect': |
41 | | - servername => 'accounts.ocf.berkeley.edu', |
42 | | - serveraliases => [ |
43 | | - 'dev-accounts', |
44 | | - 'dev-accounts.ocf.berkeley.edu', |
45 | | - 'accounts', |
46 | | - ], |
47 | | - port => 80, |
48 | | - docroot => '/var/www/html', |
49 | | - |
50 | | - redirect_status => 'permanent', |
51 | | - redirect_dest => $accounts_canonical_url; |
| 20 | + * => $accounts_options, |
52 | 21 | } |
53 | 22 |
|
54 | 23 | # wiki |
55 | | - $wiki_canonical_url = $::host_env ? { |
56 | | - 'dev' => 'https://dev-wiki.ocf.berkeley.edu/', |
57 | | - 'prod' => 'https://wiki.ocf.berkeley.edu/', |
58 | | - } |
59 | | - |
60 | 24 | $wiki_options = { |
61 | 25 | servername => 'wiki.ocf.berkeley.edu', |
62 | 26 | serveraliases => ['dev-wiki.ocf.berkeley.edu'], |
|
67 | 31 | ], |
68 | 32 | } |
69 | 33 |
|
70 | | - apache::vhost { 'wiki': |
71 | | - * => $wiki_options, |
72 | | - port => 443, |
73 | | - ssl => true, |
74 | | - headers => ['always set Strict-Transport-Security max-age=31536000'], |
75 | | - ssl_key => "/etc/ssl/private/${::fqdn}.key", |
76 | | - ssl_cert => "/etc/ssl/private/${::fqdn}.crt", |
77 | | - ssl_chain => "/etc/ssl/private/${::fqdn}.intermediate", |
78 | | - } |
79 | | - |
80 | | - # nginx backend (plain HTTP on localhost) |
81 | 34 | apache::vhost { 'wiki-backend': |
82 | | - * => $wiki_options, |
83 | | - port => $ocf_www::backend_port, |
84 | | - } |
85 | | - |
86 | | - apache::vhost { 'wiki-http-redirect': |
87 | | - servername => 'wiki.ocf.berkeley.edu', |
88 | | - serveraliases => [ |
89 | | - 'dev-wiki', |
90 | | - 'dev-wiki.ocf.berkeley.edu', |
91 | | - 'wiki', |
92 | | - ], |
93 | | - port => 80, |
94 | | - docroot => '/var/www/html', |
95 | | - |
96 | | - redirect_status => 'permanent', |
97 | | - redirect_dest => $wiki_canonical_url; |
| 35 | + * => $wiki_options, |
98 | 36 | } |
99 | 37 |
|
100 | 38 | # hello |
101 | | - $hello_canonical_url = $::host_env ? { |
102 | | - 'dev' => 'https://dev-hello.ocf.berkeley.edu/', |
103 | | - 'prod' => 'https://hello.ocf.berkeley.edu/', |
104 | | - } |
105 | | - |
106 | 39 | $hello_options = { |
107 | 40 | servername => 'hello.ocf.berkeley.edu', |
108 | 41 | serveraliases => [ |
|
118 | 51 | ], |
119 | 52 | } |
120 | 53 |
|
121 | | - apache::vhost { 'hello': |
122 | | - * => $hello_options, |
123 | | - port => 443, |
124 | | - ssl => true, |
125 | | - headers => ['always set Strict-Transport-Security max-age=31536000'], |
126 | | - ssl_key => "/etc/ssl/private/${::fqdn}.key", |
127 | | - ssl_cert => "/etc/ssl/private/${::fqdn}.crt", |
128 | | - ssl_chain => "/etc/ssl/private/${::fqdn}.intermediate", |
129 | | - } |
130 | | - |
131 | | - # nginx backend (plain HTTP on localhost) |
132 | 54 | apache::vhost { 'hello-backend': |
133 | | - * => $hello_options, |
134 | | - port => $ocf_www::backend_port, |
135 | | - } |
136 | | - |
137 | | - apache::vhost { 'hello-http-redirect': |
138 | | - servername => 'hello.ocf.berkeley.edu', |
139 | | - serveraliases => [ |
140 | | - 'dev-hello', |
141 | | - 'dev-hello.ocf.berkeley.edu', |
142 | | - 'dev-staff.ocf.berkeley.edu', |
143 | | - 'hello', |
144 | | - 'staff.ocf.berkeley.edu', |
145 | | - ], |
146 | | - port => 80, |
147 | | - docroot => '/var/www/html', |
148 | | - |
149 | | - redirect_status => 'permanent', |
150 | | - redirect_dest => $hello_canonical_url; |
| 55 | + * => $hello_options, |
151 | 56 | } |
152 | 57 | } |
0 commit comments