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,6 +256,12 @@ http {
|
||||||
{{ range $ip := $location.Whitelist.CIDR }}
|
{{ range $ip := $location.Whitelist.CIDR }}
|
||||||
allow {{ $ip }};{{ end }}
|
allow {{ $ip }};{{ end }}
|
||||||
deny all;
|
deny all;
|
||||||
|
{{ else }}
|
||||||
|
{{ if gt (len $cfg.WhitelistSourceRange) 0 }}
|
||||||
|
{{ range $ip := $cfg.WhitelistSourceRange}}
|
||||||
|
allow {{ $ip }};{{ end }}
|
||||||
|
deny all;
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
port_in_redirect {{ if $location.UsePortInRedirects }}on{{ else }}off{{ end }};
|
port_in_redirect {{ if $location.UsePortInRedirects }}on{{ else }}off{{ end }};
|
||||||
|
|
Loading…
Reference in a new issue