Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a reverse proxy to heroku

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?

like image 976
Phương Nguyễn Avatar asked Jul 06 '12 04:07

Phương Nguyễn


People also ask

Does heroku have reverse proxy?

Reverse Proxy on Heroku Run a reverse proxy using nginx on Heroku.

Does heroku use nginx?

Default behavior. Heroku will launch a FastCGI Process Manager (PHP-FPM) application server. This application server will accept requests to execute PHP files from a web server, either Apache or Nginx.


1 Answers

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.

like image 154
Douglas Barton Avatar answered Oct 13 '22 01:10

Douglas Barton