E536 Fix setting host header in action proxy in VirtualServer/VirtualServerRoute by pleshakov · Pull Request #1444 · nginx/kubernetes-ingress · GitHub
[go: up one dir, main page]

Skip to content

Conversation

pleshakov
Copy link
Contributor

Proposed changes

Previously, a configuration like below will make NGINX send two host headers to the backend - the default "$host" and the configured "bar.example.com":

apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
  name: foo 
spec:
  host: foo.example.com
  upstreams:
  - name: foo
    port: 8080
    service: backend-svc
  routes:
  - path: "/"
    action:
      proxy:
        upstream: foo
        requestHeaders:
          set:
          - name: Host
            value: bar.example.com

Now NGINX will only send one host header: by default - "$host", or the one configured in requestHeaders

I also updated some of the tests to print diffs. Otherwise, it was hard to see the mismatch in results.

@pleshakov pleshakov requested review from lucacome and soneillf5 March 11, 2021 00:21
@github-actions github-actions bot added bug An issue reporting a potential bug documentation Pull requests/issues for documentation labels Mar 11, 2021
@pleshakov pleshakov merged commit dd0aca7 into master Mar 11, 2021
@pleshakov pleshakov deleted the fix-headers branch March 11, 2021 20:00
@pleshakov pleshakov changed the title Fix setting host header in action proxy Fix setting host header in action proxy in VirtualServer/VirtualServerRoute Mar 16, 2021
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 documentation Pull requests/issues for documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0