Remove unnecessary slash for SSL redirect

Remove slash after hostname since requests directly to the hostname do not require a slash at the end and all other content goes to `$request_uri` which starts with shlash, hence no longer doubleslashes on hostname only queries.
This commit is contained in:
Timo Stramann
2019-08-18 16:07:59 +02:00
committed by GitHub
parent eca941bdae
commit 8e9ddd3d50

View File

@@ -244,7 +244,7 @@ class Nginx extends HttpConfigBase
$is_redirect = false;
} else {
$_sslport = $this->checkAlternativeSslPort();
$mypath = 'https://' . Settings::Get('system.hostname') . $_sslport . '/';
$mypath = 'https://' . Settings::Get('system.hostname') . $_sslport;
$this->nginx_data[$vhost_filename] .= "\t" . 'location / {' . "\n";
$this->nginx_data[$vhost_filename] .= "\t\t" . 'return 301 ' . $mypath . '$request_uri;' . "\n";
$this->nginx_data[$vhost_filename] .= "\t" . '}' . "\n";