Skip to content

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

@chakrit

Description

@chakrit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions