Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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