如何在同一个域后面运行两个 rails 应用程序并基于 cookie 进行 nginx 路由请求? [英] How do I run two rails apps behind the same domain and have nginx route requests based on cookie?

查看:38
本文介绍了如何在同一个域后面运行两个 rails 应用程序并基于 cookie 进行 nginx 路由请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在同一个域(例如 mydomain.com)后面运行 2 个相同的 Rails 应用程序(仅在底层数据库中不同),并根据请求中是否存在 cookie 将 Nginx 请求路由到 RailsApp1 或 RailsApp2.

I need to run 2 identical Rails apps (different only in the underlying database) behind the same domain (e.g. mydomain.com) and have Nginx route requests to RailsApp1 or RailsApp2 depending on the existence of a cookie in the request.

我该怎么做?

推荐答案

写一个 rails app 作为代理怎么样?

how about write a rails app as the proxy?

这篇关于如何在同一个域后面运行两个 rails 应用程序并基于 cookie 进行 nginx 路由请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆