nginx
nginx copied to clipboard
Fix #28. Allow directives with the same name.
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'
I've run into this problem as well. Will take a look at your PR but conceptually I think this looks fine to me :)