mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-17 06:44:12 +02:00
19 lines
457 B
Text
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 }}
|