ruby-on-rails - 在不同的服务器上运行 unicorn 和 nginx

标签 ruby-on-rails nginx reverse-proxy unicorn

大多数教程都展示了如何将 nginx Web 服务器配置为 unicorn ruby​​ 应用程序服务器的代理,当它们在同一台服务器上时;结果是它们都通过 unix 套接字进行通信。如果它们在不同的服务器上,我该如何配置它们。

最佳答案

unicorn designed只为快速客户服务:

unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. Slow clients should only be served by placing a reverse proxy capable of fully buffering both the the request and response in between unicorn and slow clients.

它如何在多节点环境之间进行负载平衡?答案是让应用程序节点 Nginx+Unicorn(通过 Unix Domain Socket 连接)和顶级 Nginx 作为单独节点上的负载均衡器。

关于ruby-on-rails - 在不同的服务器上运行 unicorn 和 nginx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31630717/

相关文章:

ruby-on-rails - Rails 将参数传递给新操作

ruby-on-rails - Rails 3/PhoneGap : Converting a Rails app into an Phonegap iOS app?

ruby-on-rails - 使用 Rack ruby​​ 服务器接收 POST

nginx:如果不存在则创建目录

php - 用于托管 PHP 网站的 Docker 架构

http - 如何与 Golang 一起使用 nginx 作为反向代理?

redis - Traefik - 无法为不同域公开具有相同端口的 redis docker 容器

css - 带有背景图像和文本的可点击区域

django - 如何使用 Apache 和 Daphne 部署 django channel ?

javascript - 由于网络转发,浏览器地址栏中的 URL 会快速更改