Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apache2: set x-forwarded headers for all proxied APIs #5

Merged
merged 3 commits into from
Feb 28, 2019

Conversation

andrewbonney
Copy link
Contributor

No description provided.

@andrewbonney
Copy link
Contributor Author

andrewbonney commented Feb 27, 2019

@samdbmg I note you were the one that added bbc/nmos-common@ed6a34c. Would you mind reviewing this PR as a result? The combination of the two seems to solve issues we saw at our last workshop.

Out of interest, is there any harm in that ProxyFix being enabled by default? From a quick test it didn't appear to cause adverse effects for http usage.

@andrewbonney andrewbonney requested a review from samdbmg February 27, 2019 14:33
Copy link
Member

@samdbmg samdbmg left a comment

Choose a reason for hiding this comment

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

The same change should probably appear in https://github.com/bbc/nmos-reverse-proxy/blob/master/debian/ips-reverseproxy-common.conf since that's the one installed by the debian package.
Otherwise this works, although /etc/nmoscommon/config.json needs to contain "fix_proxy": "enabled" for it to work; I assume that's one to handle in provisioning.

@andrewbonney
Copy link
Contributor Author

Good catch. I've added that and a version bump. You may not have seen my edited message, but do you think there's any downside to changing the default for fix_proxy to be 'enabled'?

@samdbmg samdbmg self-requested a review February 28, 2019 12:06
Copy link
Member

@samdbmg samdbmg left a comment

Choose a reason for hiding this comment

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

Looks good. As for changing the default, the Werkzeug docs say "Do not use this middleware in non-proxy setups for security reasons." (see http://werkzeug.pocoo.org/docs/0.14/contrib/fixers/#werkzeug.contrib.fixers.ProxyFix) - I think because it's possible for clients for forge that header if Apache isn't there to rewrite it. In our case I'm not sure how much that matters; outside development its rare to run a webapi without a real server proxying it and we only use that to fix redirects in a few places?

@andrewbonney
Copy link
Contributor Author

Hmm, ok. I'll leave it for now as I believe at least one open source user may be using the APIs without a proxy in front, but I don't think this is particularly advisable for several reasons, so we may change it in the future.

@andrewbonney andrewbonney merged commit ff9aaab into master Feb 28, 2019
@andrewbonney andrewbonney deleted the andrewbo-https branch February 28, 2019 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants