我们有几个在 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/