fideloper/TrustedProxy

Documentation suggestion: haproxy

dsadinoff opened this issue · 6 comments

For proxies such as haproxy, I would suggest that we mention the following snippet in the docs:

/* fixup the request proxy interpreter for haproxy */
   Request::setTrustedHeaderName(Symfony\Component\HttpFoundation\Request::HEADER_CLIENT_PROTO,'X_FORWARDED_SCHEME');

Cool -

It looks like I could use some explanation as well. It sounds like HAProxy uses a different x-forwared-for header than expected?

Does that code define which header to use (X_FORWARDED_SCHEME) in place of X-Forwarded-Proto when it determines the protocol?

Thanks!

That's right. This arguably belongs in the Laravel docs, but since your entire module is a patch for the Laravel proxy system, I figure this is the right place for a patch to the proxy docs as well.

Now I'm second-guessing myself on this one. I'm beginning to believe that my whole X-forwarded-scheme vs X-forwarded-proto weirdness was the result of following someone's nginx + haproxy recipe blindly.

Never mind.

Let me know what you find! It's totally possible haproxy does something
weird.

On Monday, March 31, 2014, dsadinoff notifications@github.com wrote:

Now I'm second-guessing myself on this one. I'm beginning to believe that
my whole X-forwarded-scheme vs X-forwarded-proto weirdness was the result
of following someone's nginx + haproxy recipe blindly.

Never mind.

Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-39098690
.

I've also had this problem when using proxypass in Apache with AWS load balancer and Laravel doesn't know the original request was https so the asset urls use http.

Is it possible that line you added in the beginning could fix this?

Marking as duplicate to #7, as the solution is the same. I'm hoping to add that as a configuration available (and documenting it).

Thanks!