Try Gemfury » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

glooby / capistrano-nginx   ruby

Repository URL to install this package:


Gem Version

nginx support for Capistrano 3.x

Makes it possible to reload/restart nginx during deploy


Add this line to your application's Gemfile:

gem 'capistrano', '~> 3.0.0'
gem 'capistrano-nginx'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-nginx


Require in Capfile to use the default task:

require 'capistrano/nginx'

Configure in deploy.rb to execute one of the tasks:

after 'deploy:published', 'nginx:reload'
after 'deploy:published', 'nginx:restart'

You can also run it in isolation: cap production nginx:reload or cap production nginx:restart

Configurable options:

set :nginx_reload_roles, :all
set :nginx_reload_command, '/etc/init.d/nginx reload'
set :nginx_restart_roles, :all
set :nginx_restart_command, '/etc/init.d/nginx restart'


To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


The gem is available as open source under the terms of the MIT License.