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