Capistrano tasks for automatic and sensible unicorn + nginx configuration
Capistrano tasks for automatic and sensible unicorn + nginx configuration
NOTE: The instructions below are no longer necessary from version 4.1.0. The dhparam file will be automatically generated if missing.
IMPORTANT NOTE. When upgrading to 4.0.0, please ensure you have generated a new 2048 bits Diffie-Hellman group. Run the following command on your server before installing this gem:
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048See for more details.
Capistrano tasks for automatic and sensible unicorn + nginx configuraion.
Goals of this plugin:
Specifics:
application is started automatically after server restart
unicorn:restartsee below for all available tasks
app nodescapistrano-unicorn-nginx works only with Capistrano 3!
Add this to Gemfile:
group :development do
gem 'capistrano', '~> 3.6.1'
gem 'capistrano-unicorn-nginx', '~> 4.1.0'
endAnd then:
$ bundle installDepending on your needs 2 general scenarios are covered:
A scenario where you run the webserver (nginx) and application server (unicorn) on the same node.
Webserver (nginx) and application server (unicorn) run on different nodes.
In order for current version to work you need upstart installed instead of systemd.
sudo apt-get install upstart-sysv package
This commando should remove ubuntu-standard and systemd-sysv.
After that go ahead and run sudo update-initramfs -u.
/var/log/nginx/#{shared_path}/log/See the full options list on the wiki page. Feel free to skip this unless you're looking for something specific.
How it works wiki page contains the list of tasks that the plugin executes.
You do not have to know this unless you want to learn more about the plugin internals.
On template customization wiki page
see how to inspect, tweak and override templates for nginx and unicorn
config files.
Do not do this unless you have a specific need.
Check out capistrano-plugins github org.
...are very welcome!
@kalys - for his capistrano-nginx-unicorn plugin.
No open issues yet, or sync has not completed.