I want to create the controller to achieve the behavior shown in the graph bellow:

Can someone provide an example if that is possible?
EDIT: Just want to proxy all post requests using Facebook SDK from Site A to Facebook (Site C) through Site B.
Found this code if its helpful:
def default
result = Net::HTTP.get_response(
"realserver.internal.net",
@request.env["REQUEST_URI"]
)
#render error if result. ...
render_text result.body
end
end
It looks like you’re trying to either hide where a request is going to, or get around the browser’s csrf protection. If the former, you would want to limit the URLs that can be requested from site C because you could potentially expose all of site C’s intranet pages over the internet. If the latter, have you considered JSONP or CORS? This would be faster for the users, and have less traffic going through site B.
Be aware that with the approach you have drawn in the diagram that you are presenting site C’s content as belonging to site B, with all the security and legal concerns this entails.
If you still want to do it the way you have described, if you can keep the same path, query string and fragment id between site B and site C, your above example would be workable.
Also, don’t refer to @request, use request. request.fullpath can be used in place of @request.env[“REQUEST_URI”]
EDIT: Also, aVenger is right, a reverse proxy would also work. Advantages: faster, less code. Disadvantages: Cannot programatically determine whether to accept the request, add dynamic variables to the request, etc. For your Facebook thing it would probably work.