41 lines
929 B
Plaintext
41 lines
929 B
Plaintext
{
|
|
|
|
my $target = $domain->prop('ProxyPassTarget') || '';
|
|
my $allow = $domain->prop('AllowHosts') || '';
|
|
my $preserve = $domain->prop('ProxyPreserveHost') || 'no';
|
|
my $keepalive = $domain->prop('ProxyNoKeepAlive') || 'no';
|
|
|
|
if ($target =~ m|https?://[\d\w\.\-/]*|){
|
|
$OUT .= " SetEnv proxy-nokeepalive 1\n" if ($keepalive eq 'yes');
|
|
$OUT .= " ProxyPass / $target\n";
|
|
$OUT .= " ProxyPassReverse / $target\n";
|
|
$OUT .= " ProxyPreserveHost on\n" if ($preserve eq 'yes');
|
|
}
|
|
else{
|
|
my $root = $domain->prop('DocumentRoot') ||
|
|
'/home/e-smith/files/ibays/Primary/html';
|
|
|
|
$OUT .= " DocumentRoot $root\n";
|
|
}
|
|
|
|
if ($allow ne ''){
|
|
if ($allow eq 'local'){
|
|
$allow = "$localAccess $externalSSLAccess";
|
|
}
|
|
else{
|
|
$allow =~ s/[,;]/ /;
|
|
}
|
|
$OUT .=<<"EOF"
|
|
|
|
<Location />
|
|
Order deny,allow
|
|
Deny from all
|
|
Allow from $allow
|
|
</Location>
|
|
|
|
EOF
|
|
}
|
|
|
|
}
|
|
|