smeserver-webapps-common/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/25SSLDirectives

28 lines
744 B
Plaintext
Raw Normal View History

2012-03-13 12:50:08 +01:00
{
my $ssl = $domain->prop('RequireSSL') || 'disabled';
2012-09-13 12:49:32 +02:00
my $auth = $domain->prop('Authentication') || 'none';
2012-03-13 12:50:08 +01:00
if (($modSSL{TCPPort} || "443") eq $port){
$OUT .= " SSLEngine on\n";
}
elsif (($ssl =~ m/^enabled|yes|on|1$/i) || ($auth =~ /^LemonLDAP/)){
2012-03-13 12:50:08 +01:00
$OUT .=<<'EOF';
RewriteEngine on
RewriteRule ^/(.*|$) https://%{HTTP_HOST}/$1 [L,R]
EOF
}
elsif ($ssl =~ m#/#){
$OUT .= " RewriteEngine on\n";
foreach my $loc (split(/[;,]/, $ssl)){
$OUT .= " # Rewriting $loc to use SSL\n";
$loc =~ s#^/##;
$OUT .= " RewriteRule ^/$loc(/.*|\$) https://%\{HTTP_HOST\}/$loc\$1 \[L,R\]\n";
}
}
else{
$OUT .= '';
}
}