百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

capistrano-unicorn-nginx

> 编程语言
开源

用于自动和合理的 unicorn + nginx 配置的 Capistrano 任务

173 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

用于自动和合理的 unicorn + nginx 配置的 Capistrano 任务

Capistrano::UnicornNginx

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 2048

See for more details.

Capistrano tasks for automatic and sensible unicorn + nginx configuraion.

Goals of this plugin:

  • automatic unicorn and nginx configuration for Rails apps
  • no manual ssh to the server required
  • zero downtime deployments enabled
  • support for single node as well as cluster deployments

Specifics:

  • generates nginx config file on the server (web role)
  • generates unicorn initializer and config files (app role)

application is started automatically after server restart

  • capistrano tasks for server management, example: unicorn:restart

see below for all available tasks

  • automatic load balancing setup when there are multiple app nodes

capistrano-unicorn-nginx works only with Capistrano 3!

Installation

Add this to Gemfile:

group :development do
  gem 'capistrano', '~> 3.6.1'
  gem 'capistrano-unicorn-nginx', '~> 4.1.0'
end

And then:

$ bundle install

Setup and usage

Depending on your needs 2 general scenarios are covered:

  • single server setup

    A scenario where you run the webserver (nginx) and application server (unicorn) on the same node.

  • multiple server setup

    Webserver (nginx) and application server (unicorn) run on different nodes.

Ubuntu 16.04

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.

Default log file directories

  • nginx: /var/log/nginx/
  • unicorn: #{shared_path}/log/

Configuration

See the full options list on the wiki page. Feel free to skip this unless you're looking for something specific.

How it works

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.

Template customization

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.

More Capistrano automation?

Check out capistrano-plugins github org.

Bug reports and pull requests

...are very welcome!

Thanks

@kalys - for his capistrano-nginx-unicorn plugin.

Issues· 32 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言