You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
808 B
28 lines
808 B
{
|
|
my $ssl = $domain->prop('RequireSSL') || 'disabled';
|
|
my $auth = $domain->prop('Authentication') || 'none';
|
|
|
|
if (($modSSL{TCPPort} || "443") eq $port){
|
|
$OUT .= " SSLEngine on\n";
|
|
}
|
|
elsif (($ssl =~ m/^enabled|yes|on|1$/i) || ($auth =~ /^LemonLDAP/)){
|
|
$OUT .=<<'EOF';
|
|
RewriteEngine on
|
|
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
|
|
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 .= '';
|
|
}
|
|
}
|
|
|
|
|