向heroku添加一个反向代理 [英] Add a reverse proxy to heroku

查看:653
本文介绍了向heroku添加一个反向代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



现在我想从 myapp反向代理。 heroku.com/proxy/ somewhereelse.com / (即: myapp.heroku.com/proxy/stuff 被反向代理为 somewhereelse.com/stuff
Heroku有可能吗?如何做到这一点?

解决方案

对于任何通过搜索来到这个问题的人,都可以这样做。 b
$ b

查看 https://github.com/ryandotsmith/nginx-buildpack 到供应商nginx到您的heroku实例中。这会将nginx放置在您的rails应用程序前面,并允许您在此域上反向代理请求,并将您的heroku应用程序配置为apex,并允许somewhereelse.com/stuff转到其他地方。


I have a rails app running on heroku at, e.g myapp.herokuapp.com.

Now I want to reverse proxy from myapp.heroku.com/proxy/ to somewhereelse.com/ (i.e: myapp.heroku.com/proxy/stuff is reverse proxifed to somewhereelse.com/stuff) Is that possible on Heroku? How to achieve this?

解决方案

For anyone coming to this question through a search, this can be done.

Check out https://github.com/ryandotsmith/nginx-buildpack to vendor nginx into your heroku instance. This will place nginx in front of your rails app, and allow you to reverse proxy requests on this domain, having your heroku app configured as apex and allowing somewhereelse.com/stuff go elsewhere.

这篇关于向heroku添加一个反向代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆