Skip to content

fix: prevent duplicate Host header in proxy configurations#9145

Open
Annefr27 wants to merge 1 commit intonginx:mainfrom
Annefr27:fix/duplicate-host-header-proxy-annotations
Open

fix: prevent duplicate Host header in proxy configurations#9145
Annefr27 wants to merge 1 commit intonginx:mainfrom
Annefr27:fix/duplicate-host-header-proxy-annotations

Conversation

@Annefr27
Copy link

In Ingress, when users define Host header in nginx.org/proxy-set-headers annotations, it was being duplicated because the code always added a default Host header automatically. The value set via the annotation had no effect.

Proposed changes

Remove the default "Host" header setting from nginx.ingress.tmpl and nginx-plus.ingress.tmpl template files.
Adds the "Host" header dynamically. If it is not defined in "master" or "minions", the default value "proxy_set_header Host $host;" is added.
This PR refers to Issue #8992

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • [ * ] I have read the CONTRIBUTING doc
  • [ * ] I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • [ * ] I have rebased my branch onto main
  • [ * ] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@github-actions github-actions bot added bug An issue reporting a potential bug go Pull requests that update Go code labels Feb 12, 2026
@Annefr27
Copy link
Author

I have hereby read the F5 CLA and agree to its terms

@AlexFenlon
Copy link
Contributor

Hi @Annefr27 thank you for making this,

I noticed the CLA has not been complete as the user @anne Peaudouyé has not accepted the CLA.

@Annefr27
Copy link
Author

Hi @Annefr27 thank you for making this,

I noticed the CLA has not been complete as the user @anne Peaudouyé has not accepted the CLA.

Hi @AlexFenlon,

I don't understand why 2 contributors have been detected.
I'm the only contributor @Annefr27.
@anne Peaudouyé is a mistake, @anne has nothing to do with me.

@AlexFenlon
Copy link
Contributor

AlexFenlon commented Feb 20, 2026

Can you please rebase with just commit using the @Annefr27 user please as the checks we have will not work otherwise, sorry!

In Ingress, when users define Host header in nginx.org/proxy-set-headers annotations,
it was being duplicated because the code always added a default Host header
automatically.
@github-actions github-actions bot added python Pull requests that update Python code github_actions Pull requests that update Github_actions code docker Pull requests that update Docker code labels Feb 20, 2026
@Annefr27 Annefr27 force-pushed the fix/duplicate-host-header-proxy-annotations branch from fa6318f to 20054ac Compare February 20, 2026 18:05
@github-actions github-actions bot removed python Pull requests that update Python code github_actions Pull requests that update Github_actions code docker Pull requests that update Docker code labels Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue reporting a potential bug go Pull requests that update Go code

Projects

Status: Todo ☑

Development

Successfully merging this pull request may close these issues.

2 participants