geerlingguy / ansible-role-nginx

Ansible Role - Nginx

Home Page:https://galaxy.ansible.com/geerlingguy/nginx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to set directives with special characters

rarguelloF opened this issue · comments

I was trying to set the following directive for my site config:

add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";

But I'm not able to, since the role adds line breaks after every ;, so the directive gets broken.

Are you sure about that? Personally I can't spot anything in this https://github.com/geerlingguy/ansible-role-nginx/blob/master/templates/vhost.j2 that would cause semicolons to split that to new lines. Maybe the ; gets escaped with jinja someway eg you arent wrapping the last bit in quites correctly.

How are you trying to set that? anyways: you can use your custom template on the vhost level:

template: "{{ playbook_dir }}/templates/site1.example.com.vhost.j2"

with that you can overcome any annoyances if in a hurry.

@FinBoWa You are right, I though I was using this nignx role but I'm using another one ¬¬

Thanks anyway! :D