Add whitelistSourceRange of global config to location block in nginx template

This commit is contained in:
Bob Violier 2017-02-21 13:19:01 +01:00
parent 5ab0f284b0
commit 203a19c780

View file

@ -256,8 +256,14 @@ http {
{{ range $ip := $location.Whitelist.CIDR }}
allow {{ $ip }};{{ end }}
deny all;
{{ else }}
{{ if gt (len $cfg.WhitelistSourceRange) 0 }}
{{ range $ip := $cfg.WhitelistSourceRange}}
allow {{ $ip }};{{ end }}
deny all;
{{ end }}
{{ end }}
port_in_redirect {{ if $location.UsePortInRedirects }}on{{ else }}off{{ end }};
{{ if not (empty $authPath) }}