ANXS / nginx

A fairly flexible and feature full Ansible role for the NGINX web server.
MIT License
151 stars 82 forks source link

Ability to set multiple directives with the same name #28

Open onsails opened 9 years ago

onsails commented 9 years ago

This configuration ends up with one proxy_set_header directive.

      location2:
        name: /tc
        proxy_pass:          http://backend:8111/tc
        proxy_http_version:  1.1
        proxy_set_header:    X-Forwarded-For $remote_addr
        proxy_set_header:    Host $host
        proxy_set_header:    Upgrade $http_upgrade
        proxy_set_header:    Connection $connection_upgrade
sascha-egerer commented 9 years ago

I've got the same problem and using

location2
    proxy_set_header:
        - "foo"
        - "bar"

ends up in

proxy_set_header ['foo', 'bar']
ericpaulbishop commented 9 years ago

I created my own version of the nginx playbook based on this one, but with a large number of tweaks (ericpaulbishop/ansible-role-nginx-server), including a syntax to specify multiple directives like you want. Maybe this will help, or you could port this part of my playbook back to this one? The relevant template file you need to make this work is the templates/site.j2 file.

pjan commented 9 years ago

We happily accept upstream PRs that fix issues you guys are running into...