Add whitelistSourceRange of global config to location block in nginx template
This commit is contained in:
parent
5ab0f284b0
commit
203a19c780
1 changed files with 7 additions and 1 deletions
|
@ -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) }}
|
||||
|
|
Loading…
Reference in a new issue