From fbcba3ef4e3dfd9b2915704ef7c0ca96771745b4 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 13 Feb 2019 15:32:41 +0100 Subject: [PATCH] remove unnecessary if-statement in nginx when redirecting to https, thx to patschi; fixes #653 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Http/Nginx.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Froxlor/Cron/Http/Nginx.php b/lib/Froxlor/Cron/Http/Nginx.php index a2f10b27..eca3e4da 100644 --- a/lib/Froxlor/Cron/Http/Nginx.php +++ b/lib/Froxlor/Cron/Http/Nginx.php @@ -244,7 +244,7 @@ class Nginx extends HttpConfigBase } else { $_sslport = $this->checkAlternativeSslPort(); $mypath = 'https://' . Settings::Get('system.hostname') . $_sslport . '/'; - $this->nginx_data[$vhost_filename] .= "\t" . 'if ($request_uri !~ ^/.well-known/acme-challenge/[-\w]+$) {' . "\n"; + $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"; } @@ -505,7 +505,7 @@ class Nginx extends HttpConfigBase // Get domain's redirect code $code = \Froxlor\Domain\Domain::getDomainRedirectCode($domain['id']); - $vhost_content .= "\t" . 'if ($request_uri !~ ^/.well-known/acme-challenge/[-\w]+$) {' . "\n"; + $vhost_content .= "\t" . 'location / {' . "\n"; $vhost_content .= "\t\t" . 'return ' . $code . ' ' . $uri . '$request_uri;' . "\n"; $vhost_content .= "\t" . '}' . "\n"; } else {