sum7/warehost
sum7
/
warehost
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
warehost/cmd/warehost-host/caddy

44 lines
949 B
Plaintext
Raw Permalink Normal View History

# ID: {{.ID}} - Domain: {{.Domain.ID}} - Profil: {{.Domain.Profil.ID}}
# Login: {{.Domain.Profil.Login.ID}} -> {{.Domain.Profil.Login.Username}}
# {{.Subdomain}} - {{.Domain.FQDN}}
{{ define "domain" }}{{if .Subdomain}}{{.Subdomain}}.{{end}}{{.Domain.FQDN}}{{ end }}
{{ define "content"}}
{{if not .Redirect}}
gzip
{{if .Proxy}}
proxy / {{.Proxy}}
{{else}}
root /srv/http/domain/{{template "domain" .}}
{{if .PHP}}
# php not supported
{{end}}
{{end}}
{{else}}
redir https://{{.Redirect}}{uri}
{{end}}
{{end}}
{{if .SSL}}
{{if .SSLRedirect}}
http://{{template "domain".}} {
{{if not .Redirect}}
redir https://{{template "domain".}}{uri}
{{else}}
{{template "content" .}}
{{end}}
}
https://{{template "domain".}} {
{{template "content" .}}
}
{{else}}
http://{{template "domain" .}},https://{{template "domain".}} {
{{template "content" .}}
}
{{end}}
{{else}}
http://{{template "domain".}} {
{{template "content" .}}
}
{{end}}