respect ssl_redirect setting for domains, fixes #542

This commit is contained in:
Michael Kaufmann (d00p)
2011-01-09 16:25:32 +00:00
parent bffa8817d9
commit cc4637095d
3 changed files with 19 additions and 5 deletions

View File

@@ -391,6 +391,14 @@ class nginx
$vhost_content.= $this->getServerNames($domain);
// respect ssl_redirect settings, #542
if($ssl_vhost == false
&& $domain['ssl'] == '1'
&& $domain['ssl_redirect'] == '1'
) {
$domain['documentroot'] = 'https://' . $domain['domain'] . '/';
}
if(preg_match('/^https?\:\/\//', $domain['documentroot']))
{
$vhost_content.= "\t".'rewrite ^(.*) '.$this->idnaConvert->encode($domain['documentroot']).'$1 permanent;'."\n";