ruby-on-rails - 用于 Mac OS 上开发的本地域名

标签 ruby-on-rails dns vagrant

我们有几个在 Vagrant 盒子中运行的 Rails 应用程序(端口转发已设置)。我们如何获得适用于这些应用程序的子域就绪开发域名?

我们不喜欢主机文件方法,因为:

  • 它需要在 URL 中指定端口 (yuk)
  • 它需要明确定义您希望使用的所有子域

最佳答案

这听起来很适合 Pow 。 Pow一般用于直接运行应用程序,但也可以端口代理。此外,它还会自动为您处理域(包括通配符子域)。

引自manual :

2.1.4 Port Proxying

Pow's port proxying feature lets you route all web traffic on a particular hostname to another port on your computer. To use it, just create a file in ~/.pow (instead of a symlink) with the destination port number as its contents.

For example, to forward all traffic for http://proxiedapp.dev/ to port 8080:

$ echo 8080 > ~/.pow/proxiedapp

You can also use port proxying to access web apps written for other runtimes such as Python or Node.js. Remember that services behind the proxy won't automatically be started or stopped like Rack apps.

关于ruby-on-rails - 用于 Mac OS 上开发的本地域名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16935092/

相关文章:

dns - DNS server 和 Host file 有区别吗?

dns - 避免 gcloud edit 中不必要的转义

linux - 浏览器通过ip更改域名,Debian,Apache2

ruby-on-rails - rails 4 PG::ConnectionBad 无法连接到服务器

ruby-on-rails - 当表单提交错误时,Rails 4 中呈现的 url 会发生变化

ruby-on-rails - 事件管理员减慢 Rails 应用程序

vagrant - 如何添加另一个虚拟主机?

Vagrant: "The box you' 重新尝试添加已经存在”

vagrant - 未检测到 stdlib 模块

ruby-on-rails - 思考狮身人面像显示选项