Skip to content

Custom headers annotation feature doesn't allowed headers with multiple value #14069

@fsologureng

Description

@fsologureng

Hello

I want to replace the following configuration-snippet annotation:

annotations:
...
    nginx.ingress.kubernetes.io/configuration-snippet: |
      add_header X-Robots-Tag "noindex";
      add_header X-Robots-Tag "noai";
      add_header X-Robots-Tag "Google-Extended: none";
      add_header X-Robots-Tag "GPTBot: none";
      add_header X-Robots-Tag "ChatGPT-User: none";
      add_header X-Robots-Tag "anthropic-ai: none";
      add_header X-Robots-Tag "CCBot: none";

with an usage of the Custom Headers annotation, but the implementation doesn't support this repeated headers setting, as the source code reveals:

// Config returns the custom response headers for an Ingress rule
type Config struct {
Headers map[string]string `json:"headers,omitempty"`
}

{{ range $k, $v := $addHeaders }}
more_set_headers {{ printf "%s: %s" $k $v | quote }};
{{ end }}

Can you declare it in the documentation please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-kindIndicates a PR lacks a `kind/foo` label and requires one.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions