nginx-ui/template/block/http-to-https.conf
2024-07-06 19:47:11 +08:00

19 lines
457 B
Text

# Nginx UI Template Start
name = "HTTP to HTTPS"
author = "@0xJacky"
description = { en = "HTTP force redirect to HTTPS Config", zh_CN = "HTTP 强制跳转 HTTPS 配置"}
[variables.host]
type = "string"
name = { en = "Host", zh_CN = "主机"}
value = ""
# Nginx UI Template End
{{- if .host }}
if ($host == {{ .host }}) {
return 308 https://$host$request_uri;
}
return 404;
{{ else }}
return 308 https://$host$request_uri;
{{- end }}