Skip to content

Conversation

@ciarams87
Copy link
Contributor

Proposed changes

Problem: When routing to an ExternalName service alongside internal services in the same HTTPRoute, NGF incorrectly sets the Host header to the Gateway's hostname instead of the external service's hostname, causing requests to fail.

Solution: Properly set Host header based on ExternalName service hostname.

Testing: Local testing using the updated examples and unit testing

Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
specific feedback, add them here.

Closes #4187

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

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Support mixed externalname and local services in single route. 
@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation labels Oct 29, 2025
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.03%. Comparing base (b41c973) to head (8e7b090).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/nginx/config/servers.go 78.57% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## main #4188 +/- ## ========================================== - Coverage 86.04% 86.03% -0.01%  ========================================== Files 131 131 Lines 14093 14111 +18 Branches 35 35 ========================================== + Hits 12126 12141 +15  - Misses 1767 1769 +2  - Partials 200 201 +1 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@ciarams87 ciarams87 marked this pull request as ready for review October 29, 2025 16:14
@ciarams87 ciarams87 requested a review from a team as a code owner October 29, 2025 16:14
Copy link
Contributor

@bjee19 bjee19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@ciarams87 ciarams87 force-pushed the fix/external-name-svc-hostname branch from 0ffb7d8 to 8e7b090 Compare November 3, 2025 09:07
@ciarams87 ciarams87 enabled auto-merge (squash) November 3, 2025 09:07
@ciarams87 ciarams87 merged commit a17baf3 into main Nov 3, 2025
61 of 62 checks passed
@ciarams87 ciarams87 deleted the fix/external-name-svc-hostname branch November 3, 2025 09:35
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation release-notes

4 participants