Skip to content

Commit

Permalink
Add whitelistSourceRange of global config to location block in nginx …
Browse files Browse the repository at this point in the history
…template
  • Loading branch information
bviolier committed Feb 21, 2017
1 parent 5ab0f28 commit 203a19c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand Down

0 comments on commit 203a19c

Please sign in to comment.