From bd6609226b4cd717cad07743f61c36db91847eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=82=B3?= <63220331+wcbing@users.noreply.github.com> Date: Sat, 6 Jul 2024 00:54:24 +0800 Subject: [PATCH] fix: http-to-https use $host and 301 --- template/block/http-to-https.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/block/http-to-https.conf b/template/block/http-to-https.conf index b53dbd48..65a31960 100644 --- a/template/block/http-to-https.conf +++ b/template/block/http-to-https.conf @@ -11,9 +11,9 @@ value = "" {{- if .host }} if ($host == {{ .host }}) { - return 307 https://$server_name$request_uri; + return 301 https://$host$request_uri; } return 404; {{ else }} -return 307 https://$server_name$request_uri; +return 301 https://$host$request_uri; {{- end }}