Simplest way to forward HTTP requests to a different server

PROXYreverse-proxy

I have a mobile app that needs to communicate with a third-party server over an HTTP API. But the third-party server can be accessed only from an approved IP addresses, meaning that I need to put my server (whose IP has been approved) between the app and the third-party server.

What's the simplest way to set up the server? I basically need my server to simply forward HTTP requests to a different server.

Best Answer

To start, I would set up Nginx as a reverse proxy to the third-party server. You can read about how that works here: http://nginx.com/resources/admin-guide/reverse-proxy/, an example setup might look like:

server {

  listen 80;
  server_name example-proxy-domain.com;

  location /some/path/ {
      proxy_pass http://www.example-third-party-domain.com/link/;
  }
}
Related Topic