when front proxy meet reverse proxy

Jonathan Matthews contact at jpluscplusm.com
Wed Mar 28 16:01:58 UTC 2012


On 28 March 2012 15:27, maven apache <apachemaven0 at gmail.com> wrote:
> 2012/3/28 Guzmán Brasó <guzman.braso at gmail.com>
>> I saw the picture but don't see any problem for nginx there, your
>> problem in that picture seems to be that you want your backend to
>> access crossdomain server but your backend do not have internet acces.
>
> Yes,this is what I want.
>
>> If that's the case, and you don't need to support thousands of cross
>> domains, you can configure Nginx to be reverse proxy of cross domain
>> server and use it to access internet from your backend, so when the
>> backends want to access crossdomain, it does so through nginx and
>> nginx indeed have internet access.
>
> Can you explain more about use the nginx be the reverse proxy of the cross
> domain?

You need to tell nginx it should accept requests for the different
cross-domain FQDNs you're using, and proxy_pass them in nginx as
appropriate.

Then arrange for your app to make its requests to nginx, not the
unreachable cross-domain server.
You may need to hosts-file the FQDNs on your app server if you can't
change the app and make it separate its understanding of the HTTP Host
header ("cross.domain.whatever.com") from the actual IP it should talk
(nginx).

It's a pretty simple setup.
We *could* write the nginx config to do this for you, but we'd be
depriving you of the excellent learning experience you'll get doing it
yourself ;-)

Have fun!

Jonathan



More information about the nginx mailing list