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

Not possible to specify some configuration key multiple times. #5

Open
chakrit opened this issue Feb 4, 2014 · 6 comments
Open

Not possible to specify some configuration key multiple times. #5

chakrit opened this issue Feb 4, 2014 · 6 comments

Comments

@chakrit
Copy link

chakrit commented Feb 4, 2014

Example is the proxy_set_header that should allows us to adds multiple headers to requests. This fails due to the nature of YML — when specifying multiple keys the last entry simply overrides it.

Example in YML:

nginx_sites:                                                          
  - server:                                                           
      file_name: app                                                  
      listen: 80                                                      
      server_name: 'ubuntu1204'                                       
      location1:                                                      
        name: '/'                                                     
        proxy_pass: 'http://0.0.0.0:8080'                             
        proxy_redirect: "off"                                         
        proxy_buffering: "off"                                        
        proxy_set_header: 'Host $host'                                
        proxy_set_header: 'X-Real-IP $remote_addr'                    
        proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'

Resulting configuration output:

location / {                                                     

    proxy_buffering off;                                         

    proxy_pass http://0.0.0.0:8080;                              

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 

    proxy_redirect off;                                          
}                                                                

See also: http://wiki.nginx.org/HttpProxyModule

@jdauphant
Copy link

I have made pullrequest that correct this problem : #3
My fork is also available in galaxy repository :
https://galaxy.ansible.com/list#/roles/466
This fork change the syntax.

@chakrit
Copy link
Author

chakrit commented Mar 16, 2014

@jdauphant wow, thanks!

@isho
Copy link

isho commented Jul 31, 2014

Is this fix going in anytime soon?

I ran into a similar issue configuring SSL. I would love to be able to use Nginx's ability to configure both http and https ports in one server directive like so:

- server:
       listen: 80
       listen: 443 ssl

@isho
Copy link

isho commented Jul 31, 2014

I guess I should switch to using this role?

https://galaxy.ansible.com/list#/roles/466

@jdauphant
Copy link

Yes I have fix that in my role :)

@srkiNZ84
Copy link

Just got hit by this as well. Will switch to @jdauphant's role. Hoping it's an easy switch over.

I do note that Ubuntu is not mentioned in the "Supported Platform's" list: https://galaxy.ansible.com/detail#/role/466
hoping this is just meaning that there's no formal testing on Ubuntu.

Thank you! 😄

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

4 participants