Merge pull request #809 from aledbf/fix-variables-map

Fix dynamic variable name
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-06-02 11:59:32 -04:00 committed by GitHub
commit 66b4c2606b
3 changed files with 33 additions and 2 deletions

View file

@ -245,7 +245,7 @@ http {
{{ if isLocationAllowed $location }}
{{ if gt (len $location.Whitelist.CIDR) 0 }}
geo $the_real_ip $deny_{{ $server.Hostname }}_{{ $path }} {
geo $the_real_ip {{ buildDenyVariable (print $server.Hostname "_" $path) }} {
default 1;
{{ range $ip := $location.Whitelist.CIDR }}
@ -337,7 +337,7 @@ http {
{{ if isLocationAllowed $location }}
{{ if gt (len $location.Whitelist.CIDR) 0 }}
if ($deny_{{ $server.Hostname }}_{{ $path }}) {
if ({{ buildDenyVariable (print $server.Hostname "_" $path) }}) {
return 403;
}
{{ end }}