This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Enable X-Forwarded-* headers to be accepted.
AbandonedPublic

Authored by marxin on Sep 4 2018, 12:50 AM.

Details

Reviewers
MatzeB
cmatthews
Summary

When running behind a HTTP proxy, one needs to accept X-Forwarded-* headers to properly generate URLs.

Diff Detail

Event Timeline

marxin created this revision.Sep 4 2018, 12:50 AM
cmatthews requested changes to this revision.Sep 4 2018, 11:24 AM

The docs mention "Do not use this middleware in non-proxy setups for security reasons." I would assume because this allows the client to set the host information. I use this in our setups. I think I apply it in the app launch file that we hand to gunicorn instead of here.

Also, you displaced the comment that was for the next line of code.

This revision now requires changes to proceed.Sep 4 2018, 11:24 AM

The docs mention "Do not use this middleware in non-proxy setups for security reasons." I would assume because this allows the client to set the host information. I use this in our setups. I think I apply it in the app launch file that we hand to gunicorn instead of here.

Ah, I see. I'm running LNT within Apache instance that is behind a different HTTP proxy. Maybe one can somehow tweak Apache to help here, but I was unable to find anything.
That said, I'll probably need ProxyFix. What about making that conditional based on a config variable in lnt.cfg?

Also, you displaced the comment that was for the next line of code.

What are you using for the backend web server?

marxin added a comment.Sep 5 2018, 1:37 AM

I use Apache2 + mod_wsgi.

marxin abandoned this revision.Oct 11 2018, 5:47 AM