Add reverse proxy to gerok

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

Now I want to cancel the proxy server from myapp.heroku.com/proxy/ to somewhereelse.com/ ( myapp.heroku.com/proxy/stuff .: myapp.heroku.com/proxy/stuff with a myapp.heroku.com/proxy/stuff to somewhereelse.com/stuff ) Is this possible on Geroku? How to achieve this?

+6
source share
2 answers

For those who come to this question through a search, this can be done.

Drop the https://github.com/ryandotsmith/nginx-buildpack provider to nginx into your heroku instance. This will put nginx in front of your rail application and allow you to cancel proxy requests in this domain if your heroku application is configured as top and allows whereelse.com/stuff to move to another location.

+7
source

You do not have access to the routing infrastructure, so it is impossible to add something like a proxy server based on nginx or apache modproxy. In my opinion, you can only bind to one port ($ PORT) inside the dynamometer so that it is not possible to obscure your Rails application with your own version of nginx with the manufacturer (unless it is possible to communicate via a non-TCP / IP socket between nginx and your application for racks / rails, if so, then maybe you can get a rack to listen to /tmp/mysocket.git and nginx for a reverse proxy, it may not be a starter, although I just throw away ideas),

This means the only plausible option, if you have to deal with it yourself in your rails application, I only have a tiny tiny bit of rails / ruby, but if rails does not have proxy functionality, you can probably explicitly accept and then use http- client to call other parts.

0
source

Source: https://habr.com/ru/post/919815/


All Articles