Deployment 单个Nginx服务器上的多个Meteor应用程序

Deployment 单个Nginx服务器上的多个Meteor应用程序,deployment,nginx,meteor,server,meteor-up,Deployment,Nginx,Meteor,Server,Meteor Up,我在服务器上安装了nginx,我可以让运行在不同端口上的meteor应用程序在不同的“文件夹”中运行。以下是配置: server { listen *:80; server_name meteor.example.com; access_log /var/log/nginx/meteor.example.com.access.log; error_log /var/log/ngin

我在服务器上安装了nginx,我可以让运行在不同端口上的meteor应用程序在不同的“文件夹”中运行。以下是配置:

server {
  listen                *:80;

  server_name           meteor.example.com;

  access_log            /var/log/nginx/meteor.example.com.access.log;
  error_log             /var/log/nginx/meteor.example.com.error.log;

  location /app1 {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header X-Forwarded-For $remote_addr;
  }
  location /app2 {
    proxy_pass http://127.0.0.1:8000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header X-Forwarded-For $remote_addr;
  }
问题是,当我尝试在任何一个应用程序中导航时,url的文件夹部分都会被重写

例如,如果我在meteor.example.com/app1,并且我尝试导航到联系人页面,则url将更改为meteor.example.com/contact,而不是meteor.example.com/app1/contact

此外,当我访问meteor.example.com/app1时,我的应用程序中出现了404,因为路由器似乎认为我正在尝试导航到应用程序中名为app1的页面

我已将app1上的ROOT_URL设置为,但这似乎无法解决此问题

同样,我可以通过访问meteor.example.com/[appname]正确访问每个应用程序,但我在应用程序中得到了404,因为它认为[appname]是我试图导航到的页面

任何帮助都将不胜感激,谢谢


如果这是有用的信息,我将使用meteor up作为我的部署工具。

如果您愿意为每个应用程序使用不同的子域,这将变得容易得多。这是可能的吗?这似乎是本地存储的一个问题,根据这个:好的,看起来这可能还不是100%可能的。在不同的子域上运行可能是目前唯一的方法。然而,这个问题的答案似乎表明这是可能的。