nginx_ui/nginx-ui-dev/template/block/http-to-https.conf
2025-03-04 11:28:12 +00:00

20 lines
457 B
Plaintext

# 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 }}