同一端口上可能有多个铁轨项目? [英] is it possible to have multiple project of rails on same port?

查看:113
本文介绍了同一端口上可能有多个铁轨项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在当前的Rails应用程序之外添加一个新项目,而无需为此启动新服务器.

I want to add a new project beside of my current rails app without starting a new server for that.

我认为不可能在一个端口上有两个Rails应用程序,但是我的老板想要它.

I think it is impossible to have two rails app on one port but my boss want it.

有可能吗?

推荐答案

是,不是.您不能运行两个Web服务器,例如美洲狮,在同一港口.那行不通.但是您可以运行一台Web服务器来服务两个Rails应用程序.传入请求根据其子域(app1.example.com)或路径(example.com/app1)进行路由.

Yes and no. You can't run two web servers, e.g. Puma, on the same port. That won't work. But you can run one web server to serve two Rails apps. Incoming requests are routed based on either their subdomain (app1.example.com) or their path (example.com/app1).

一个常见的设置是将Apache/nginx用作Web服务器,并与Passenger一起用作应用程序服务器.这个问题会问一个类似的问题,并指向旅客的有关如何从子域提供应用程序的文档:

A common setup is to use Apache/nginx as the web server in combination with Passenger as the application server. This question ask a similar question and points to Passenger's documentation on how to serve apps from subdomains: How to deploy multiple rails app on a single IP (Apache + Passenger)?

配置在很大程度上取决于您的设置,因此我无法为您提供更详细的答案.但是,搜索多个应用程序"以及Web和应用程序服务器的组合应该会产生足够的结果和教程,以帮助您解决问题.

The configuration depends heavily on your setup, so I can't give you a more detailed answer. But searching for "multiple apps" and the combination of your web and application server should yield enough results and tutorials for you to solve your problem.

这篇关于同一端口上可能有多个铁轨项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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