-
Notifications
You must be signed in to change notification settings - Fork 246
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
D7 custom - decoupled upstreams & limit_zones #203
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
I've been working on some changes to your D7 branch that you may be interested in and I'd like to hear your feedback.
I started by decoupling the upstream blocks from nginx.conf and the apps config files as I needed to be able to host different applications on the same nginx server while using different backends for each.
I also decoupled the zones (limit_conn_zone, limit_req_zone and microcache zones) so nginx.conf need not be modified when adding or removing one; I need this flexibility to use fail2ban.
I added a blockips.conf file which I also need for fail2ban (but can be used independently of it, of course), as well as map_mobile_useragent.conf which implements the change for the fastcgi_cache_key you documented in https://gist.github.com/perusio/1326701.
Still needs a bit of updating in the documentation of the example vhost but, basically, to select a backend for a vhost you'd just set the variable $upstream_id to the upstream name.
I'm not particularly crazy about the "proxy 0.0.0.0/0;" in the ACLs but I haven't seen any other solution to blocking access to status pages while behind a proxy (maybe it should default to /32 instead to be consistent with the real_ip config).
I've only tested this with PHP 5.5.9-1ubuntu4.5 (fpm-fcgi) and nginx/1.7.7 on Ubuntu 14.04.1, and only with drupal.conf but everything seems to be working as it should.
Looking forward to hearing from you