0

我正在使用两个 rails 应用程序,在本地运行rails szeus s -p3001。当我尝试在另一台机器上运行我的应用程序时,以 webbrick 启动的服务器在另一个系统上运行良好,但无法运行 zeus。请帮帮我。

我只是在浏览器中给出了网址192.168.1.111:3000(正在运行)。和

`192.168.1.111:3001` (server not found).

我试过zeus s -b 192.168.1.111:3001但没有帮助我。

4

1 回答 1

1

问题是,宙斯绑定到本地地址(127.0.0.1),禁止删除主机的连接。正确的解决方案是使用 apache2 或 nginx 设置反向代理。

或者,您可能还想使用防火墙来重定向请求。

但是一个快速而肮脏的解决方案是使用 SSH 端口转发,如下所示:

  • 在端口 3000 上的远程计算机上启动 zeus
  • 在本地机器上

    local-machine$ ssh -L 3001:localhost:3000 remote-machine
    
  • 在本地机器上:连接到localhost:3001而不是到remote-machine:3000

http://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html

于 2015-08-27T06:22:39.273 回答