【发布时间】:2014-09-03 13:44:29
【问题描述】:
我想使用 nginx + unicorn 托管多个 Rails 应用程序,目前正在使用带有 railsbaseuri 的 apache + 乘客服务。唯一的原因是在部署每个新应用程序后都需要重新加载 apache。我想知道是否可以在 unicorn+nginx 中添加新应用程序而无需重新加载服务器。
我想在 host-name/nginx-app1、host-name/nginx-app2 等子文件夹上部署应用程序,而 host-name 指向一个基本的 html 页面。
阅读与使用套接字处理单个应用程序相关的内容,并寻求一些帮助来实现这一点。在我的情况下,应用程序只部署一次,没有进一步的迭代。一旦我部署了新的应用程序,就不应该有停机时间来使当前的应用程序运行。
编辑 应用程序中的 config/unicorn.rb 文件。
working_directory "/home/ubuntu/application_1"
pid "/home/ubuntu/application_1/pids/unicorn.pid"
stderr_path "/home/ubuntu/application_1/log/unicorn.log"
stdout_path "/home/ubuntu/application_1/log/unicorn.log"
listen "/tmp/unicorn.todo.sock"
worker_processes 2
timeout 30
【问题讨论】:
标签: ruby-on-rails-3 nginx ubuntu-12.04 unicorn