Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

location_cfg_prepend hash keys ignored #49

Closed
igama opened this issue May 3, 2013 · 8 comments
Closed

location_cfg_prepend hash keys ignored #49

igama opened this issue May 3, 2013 · 8 comments

Comments

@igama
Copy link

igama commented May 3, 2013

I'm setting up a vhost, that should only be accessible from some IP's. Im passing the location_cfg_prepend a hash with the allow and deny keys/values.

nginx::resource::vhost { "sub.example.org":
  ensure   => present,
  proxy  => "http://sub_example_org",
  location_cfg_prepend => { 'allow' => 'IP1', 'allow' => 'IP2', 'allow' => 'IP3', 'deny' => 'all'}
}

However what I see in the config generated is :

server {
listen                *:80 ;

server_name           sub.example.org;
access_log            /var/log/nginx/sub.example.org.access.log;

location / {
 allow IP3;
 deny all;
 proxy_pass http://sub_example_org;
 proxy_read_timeout 90;
}}

Any idea what is happening to the other IPs ? why only IP3 is in the config file?

@jfryman
Copy link
Contributor

jfryman commented May 3, 2013

The value for the key 'allow' is three different values (IP{1,2,3}).

It looks like for this to work, it should be an array of keys in order to allow multiple 'allow' blocks to be used.

@jfryman
Copy link
Contributor

jfryman commented May 3, 2013

This will need some code modification.

@igama
Copy link
Author

igama commented May 6, 2013

hmm ok, so i'll create 2 variables, $location_allow and $location_deny, since these are the only options that can appear multiple times on the nginx location config. Sounds good?

@jfryman
Copy link
Contributor

jfryman commented May 6, 2013

That would probably work - if you create the variable to take an array, and then iterate through them in the template. That would be 👍

@igama
Copy link
Author

igama commented May 7, 2013

👍 I'll try and great a pull request with the code today ;)

@apenney
Copy link

apenney commented Sep 4, 2013

#131 should add this.

@jfryman
Copy link
Contributor

jfryman commented Sep 4, 2013

Looks good. Thanks!

@jfryman jfryman closed this as completed Sep 4, 2013
@igama
Copy link
Author

igama commented Sep 6, 2013

👍 thanks! forgot to do the PR after...

cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this issue Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants