nginx icon indicating copy to clipboard operation
nginx copied to clipboard

Fix #28. Allow directives with the same name.

Open Couto opened this issue 9 years ago • 1 comments

It's the first time that I use the Jinja2 template system, so I'm not really sure about the correctness of this fix.

I wanted to reuse multiple directives with the same name, much like specified in #28 e.g.:

- server:
  listen: '[::]:443 ssl'
  listen: '443 ssl'
  location1: 
    name: /
    proxy_set_header: X-Real-IP $remote_addr
    proxy_set_header: Upgrade $http_upgrade
    proxy_set_header: Connection $connection_upgrade

However this doesn't work.

With this PR (that might need testing by someone with more experience than me) the following should work:

- server:
  listen:
    - '[::]:443 ssl'
    - '443 ssl'
  location1: 
    name: /
    proxy_set_header: 
      - 'X-Real-IP $remote_addr'
      - 'Upgrade $http_upgrade'
      - 'Connection $connection_upgrade'

Couto avatar Oct 01 '15 15:10 Couto

I've run into this problem as well. Will take a look at your PR but conceptually I think this looks fine to me :)

otakup0pe avatar Nov 03 '16 15:11 otakup0pe