question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

x-forwad-proto header is not forwarded correctly to authentication service

See original GitHub issue

Describe the bug We use datawire ambassador behind nginx as an ingress controller. Since Nginx does the tls termination there is already an x-forwad-proto header set when the request hits ambassador. If the request is now forwarded to our authentication service the value of this header changes from https to http.

To Reproduce

Deploy an Authentication Service like described here https://www.getambassador.io/user-guide/auth-tutorial/#1-deploy-the-authentication-service but with ambassador behind nginx as ingress controller doing also tls termination.

Expected behavior x-forward-proto should not be changed and forwarded with the correct value https to the authentication service.

Versions

  • Ambassador: 0.50.rc
  • Kubernetes environment bare metal
  • Version 1.13.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
mthirdcommented, Jan 22, 2019

From looking at this thread, it appears that only the authentication gets the “correct” header (https), but upstream services still see http.

In our case, we use fly.io’s wormhole to do edge ssl termination which forwards requests to port 80 within ambassador. We would except the x-forwarded-proto to respect the original proto header, but it is changing it to http.

The headers we received in 0.40.2 looked like:

"x-forwarded-for": "4.xx.xx.xx",
"x-forwarded-host": "host.example.com",
"x-forwarded-port": "443",
"x-forwarded-proto": "https",
"x-forwarded-ssl": "on",
"x-forwarded-uri": "/",

However, the headers in all of the 0.50.0-* releases look like (this is 0.50.0-rc5):

"x-forwarded-for": "4.xx.xx.xx,10.xx.xx.xx",
"x-forwarded-host": "host.example.com",
"x-forwarded-port": "443",
"x-forwarded-proto": "http",
"x-forwarded-ssl": "on",
"x-forwarded-uri": "/"

Is this by design?

1reaction
kflynncommented, Jan 24, 2019

@gsagula, can you speak to this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

x-forwad-proto header is not forwarded correctly to ... - GitHub
From looking at this thread, it appears that only the authentication gets the "correct" header (https), but upstream services still see http. In ......
Read more >
x-forwad-proto header is not forwarded correctly to authentication ...
Describe the bug. We use datawire ambassador behind nginx as an ingress controller. Since Nginx does the tls termination there is already an...
Read more >
Using the Forwarded header - NGINX
Traditionally, an HTTP reverse proxy uses non-standard headers to inform the upstream server about the user's IP address and other request properties:.
Read more >
X-Forwarded-Proto - HTTP - MDN Web Docs
The X-Forwarded-Proto (XFP) header is a de-facto standard header for identifying the protocol (HTTP or HTTPS) that a client used to connect ...
Read more >
asp.net header forwarding not working for external Identity ...
After some digging I found the mistake: I did add the wrong proxy IP. Since my asp.net app is hosted on docker, I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found