Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Strict-Transport-Security header gets mangled #194

@apenney

Description

@apenney

Hi, we have the following variable set:

nginx_http_params:
  - server_names_hash_bucket_size 256
  - server_tokens           off
  - etag                    on
  - if_modified_since       before
  - types_hash_max_size     2048

  - add_header X-Frame-Options SAMEORIGIN
  # Add HSTS
  - add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always

And this gets turned into:

   add_header Strict-Transport-Security "max-age=31536000;
       includeSubDomains" always;

Is there a way to escape or exclude a ; from being parsed in templates/site.conf.j2? I assume it's getting hit by:

   {% if v != "" %}{{ v.replace(";",";\n      ").replace(" {"," {\n      ").replace(" }"," \n   }\n") }}{% if v.find('{') == -1%};

To add the \n no matter what. This is causing us to have an incorrect header that breaks Cloudflare.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions