My situation is as follows: I have a server (A) set up with a VPN connection to a third-party server (B). I have a collection of other servers (C, D, E...) that share the same private network as my VPN-connected server (A).

The third-party server (B) provides a RESTful API that is accessible through HTTP. For instance, from server A I can request some URL:

$ curl http://<server-B-vpn-ip-address>/path/to/whatever

And I will receive a JSON response with the appropriate data.

I want to be able to access server B's API from any server (C, D, E...) by making a call to server A. For instance:

$ curl http://<server-A-private-ip-address>/path/to/whatever

Server A should then forward that request to server B, and it should return the JSON response to whichever server initially requested it.

I've looked at a few possible ways to solve this with iptables without success, but honestly I don't know what the right tool for the job is in this case. Does anyone have any ideas?

1 Answer 1


I ended up solving this problem by implementing a reverse proxy on server A that modified the request headers before forwarding the request to server B.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.