Update nginx.tmpl

- Add VIRTUAL_PROTO=custome
This commit is contained in:
废墟 2022-07-16 20:45:14 +08:00
parent c4ad18fecc
commit 76ba6b6f58

View file

@ -51,6 +51,11 @@
{{ end }} {{ end }}
{{ define "location" }} {{ define "location" }}
{{ if eq .Proto "custome" }}
{{ if (exists (printf "/etc/nginx/vhost.d/%s_location" .Host)) }}
include {{ printf "/etc/nginx/vhost.d/%s_location" .Host }};
{{ end }}
{{ else }}
location {{ .Path }} { location {{ .Path }} {
{{ if eq .NetworkTag "internal" }} {{ if eq .NetworkTag "internal" }}
# Only allow traffic from internal clients # Only allow traffic from internal clients
@ -84,6 +89,7 @@
{{ end }} {{ end }}
} }
{{ end }} {{ end }}
{{ end }}
{{ define "upstream" }} {{ define "upstream" }}
{{ $networks := .Networks }} {{ $networks := .Networks }}