1

我有两个问题,我试图将 jasmine rails ruby​​gem 的 IP 地址绑定到 localhost 以外的其他东西。

原因是我使用 Ruby on rails 进行开发,50% 的时间我在笔记本电脑上,另外 50% 的时间我在 PC 上工作。所以我需要能够使用两台机器从浏览器访问它。

我尝试在 Linux 机器上使用 X 转发,但这非常缓慢并且减慢了我的工作。

所以我的两个问题是,对于 Rails 方式 1:我是否应该将 jasmine 绑定 IP 更改为其他内容,如果是,如何?2:我是否应该在两台机器上分别运行开发服务器,而不是只从笔记本电脑上通过 ftp 上传到 PC?

4

1 回答 1

0

我可以通过将它添加到我的 nginx conf 来解决这个问题

server {
    server_name         example.com;
    root /home/user/rails/public;
    location / {
        proxy_pass         http://localhost:8888;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_set_header   Host 127.0.0.1;
        proxy_redirect     off;
        proxy_http_version 1.1;
        proxy_buffering    off;
        proxy_cache_bypass $http_pragma $http_authorization;
        proxy_no_cache     $http_pragma $http_authorization;
    }

}
于 2016-11-02T21:07:15.323 回答