Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在nginx上托管多个类似于apache的网站_Ruby On Rails_Ruby_Deployment_Nginx - Fatal编程技术网

Ruby on rails 在nginx上托管多个类似于apache的网站

Ruby on rails 在nginx上托管多个类似于apache的网站,ruby-on-rails,ruby,deployment,nginx,Ruby On Rails,Ruby,Deployment,Nginx,我正在尝试在nginx中托管多个类似于apache的网站。在apache中,我们有一个名为htdocs的文件夹。我们将目录和文件放在htdocs中,如果URL类似 www.example.com 然后我们可以访问htdocs文件夹中的目录和文件 www.example.com/exampledir1和www.example.com/exampledir2 我想用nginx做同样的事情。有可能吗。我公司有一台服务器,它有一个静态IP。我在上面安装了nginx,默认情况下,我在nginx.conf

我正在尝试在nginx中托管多个类似于apache的网站。在apache中,我们有一个名为htdocs的文件夹。我们将目录和文件放在htdocs中,如果URL类似

www.example.com
然后我们可以访问htdocs文件夹中的目录和文件

www.example.com/exampledir1
www.example.com/exampledir2

我想用nginx做同样的事情。有可能吗。我公司有一台服务器,它有一个静态IP。我在上面安装了nginx,默认情况下,我在
nginx.conf
文件中托管了一个rails应用程序

server {
  listen 80;
  server_name mycomp.does-it.net;
  root /var/www/mysamplerails/public;
  passenger_enabled on;
  rails_env development;
}
如果我转到url“mycomp.doit.net”,我就可以访问此网站

现在,我想做的是创建另一个rails应用程序,并从mycomp.doit.net/mysecondrailsapp作为根目录访问它


我在谷歌上搜索了很多次,结果什么也没找到。我来自apache背景,这是我在nginx中的第一次尝试。

使用乘客基础uri选项。见文件: