|
|
|
@ -1,16 +1,35 @@ |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
my $target = $domain->prop('ProxyPassTarget') || ''; |
|
|
|
|
my $redirect = $domain->prop('Redirect') || ''; |
|
|
|
|
my $rewrite = $domain->prop('Rewrite') || ''; |
|
|
|
|
my $allow = $domain->prop('AllowHosts') || ''; |
|
|
|
|
my $preserve = $domain->prop('ProxyPreserveHost') || 'no'; |
|
|
|
|
my $keepalive = $domain->prop('ProxyNoKeepAlive') || 'no'; |
|
|
|
|
|
|
|
|
|
# ProxyPass ? |
|
|
|
|
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'); |
|
|
|
|
} |
|
|
|
|
# Rewrite ? |
|
|
|
|
elsif ($rewrite =~ m|https?://[\d\w\.\-/]*|){ |
|
|
|
|
$OUT .=<<"HERE"; |
|
|
|
|
|
|
|
|
|
RewriteRule /(.*|\$) $rewrite/\$1 [L,R] |
|
|
|
|
|
|
|
|
|
HERE |
|
|
|
|
} |
|
|
|
|
# Redirect ? |
|
|
|
|
elsif ($redirect =~ m|https?://[\d\w\.\-/]*|){ |
|
|
|
|
$OUT .=<<"HERE"; |
|
|
|
|
|
|
|
|
|
RedirectMatch permanent ^/(.*|\$) $redirect/\$1 |
|
|
|
|
|
|
|
|
|
HERE |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
my $root = $domain->prop('DocumentRoot') || |
|
|
|
|
'/home/e-smith/files/ibays/Primary/html'; |
|
|
|
|