jdauphant / ansible-role-nginx

Ansible role to install and manage nginx configuration
655 stars 302 forks source link

fix settings with quotes in sites template #151

Closed demik closed 7 years ago

demik commented 7 years ago

Adding a setting with quotes like this in nginx_sites: add_header X-XSS-Protection "1; mode=block"

results in the following beeing generated in the config file : add_header X-XSS-Protection "1; mode=block";

Some software are having trouble with multiline headers like this. This is due to the template confusing raw configuration and quoted settings. This PR fixes the issue.

Also, mark FreeBSD versions up to 11.0 as compatible.

jdauphant commented 7 years ago

Thanks @demik for the MR. You have also this problem with the new notation ?

nginx_sites:
   test: 
      - |
        listen 443 ssl;
        server_name foo.example.com;
        add_header X-XSS-Protection "1; mode=block";

In the futur, the idea is to replace the old notation completely by the new notation (If you have feedbacks about that, don't hesitate :)

jdauphant commented 7 years ago

@demik have you seen my comments ?

demik commented 7 years ago

Now I have :) I will test with the new notation and keep you updated.

demik commented 7 years ago

@jdauphant Ok got it tested and it works fine indeed. Mixing nginx and yml syntax feels a little weird, but that's ok

Thanks for the workaround. I guess only the FreeBSD version commit is useful then :)

jdauphant commented 7 years ago

@demik Yep, I was thinking to migrate to a full nginx syntax.

We can merge the FreeBSD version commit :)

jdauphant commented 7 years ago

Can you edit the PR ?

demik commented 7 years ago

Done :)

jdauphant commented 7 years ago

Thanks :)